setIn behavior contradicts documentation
See original GitHub issueProblem
Using collectable@0.22.0
It looks like C.setIn()
tries to interact with values at times when I expect it to be interacting with keys.
See this webpackbin for a demo.
Take special note of map2
, which is the operation that appears to throw the type error. Copy-pasted from the README:
import * as C from 'collectable';
const input = {
foo: 'abc', <--- setIn tries to do stuff to 'abc' when it should be operating on input.foo...
xyz: [3, [5, 6], 7, 9]
};
const map0 = C.from(input); // <{foo: 'abc', xyz: <[3, [5, 6], 7, 9]>}>
const map1 = C.updateIn(['xyz', 1, 0], n => 4, map0); // <{foo: 'abc', xyz: <[3, [4, 6], 7, 9]>}>
const map2 = C.setIn(['foo', 'bar'], x => 'baz', map1); // <{foo: <{bar: 'baz'}>, xyz: ...>
VM181 dll.js:9431 Uncaught TypeError: Cannot use 'in' operator to search for '@@is-collection' in abc
at isCollection (VM181 dll.js:9431)
at isIndexedCollection (VM181 dll.js:9434)
at setDeep (VM181 dll.js:7644)
at path.length.__WEBPACK_IMPORTED_MODULE_0__collectable_core__.IndexedCollection.updateEntry (VM181 dll.js:7647)
at update (VM181 dll.js:9817)
at HashMapStructure.@@update (VM181 dll.js:3664)
at Object.updateEntry (VM181 dll.js:9425)
at setDeep (VM181 dll.js:7647)
at Object.setIn (VM181 dll.js:7639)
at Object.<anonymous> (VM182 main.js:96)
Desired Outcome
-
If the documentation is misleading, then the example would be corrected to demonstrate the actual
setIn()
behavior. This is likely, since there are many calls for documentation throughout the project. -
If the documentation reflects the intended API correctly, then this is a bug in the implementation of
setIn()
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
mode is mandatory, which contradicts docs · Issue #1111
Current behavior With a basic configuration, semantic-release throws an error saying no mode is specified. Expected behavior The docs say that by default ......
Read more >Documentation on encryption context in contradiction with ...
"When an encryption context is provided in an encryption request, it is cryptographically bound to the ciphertext such that the same encryption context...
Read more >How Taking Inconsistent Positions Can Lead to Dismissal ...
This is because the doctrine prevents a contradictory position, but does not examine the truth of either statement made by a litigant.
Read more >Re: Reporting Nodes Added Automatically When Moving iSCSI- ...
This behavior contradicts NetApp documentation which indicates it must be done manually. Has anyone else encountered this? Does anyone know if there's a ......
Read more >INTERROGATION TECHNIQUES
The Reid website describes the Behavior Analysis Interview (BAI) as a non-accusatory question and answer session, involving both standard investigative ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@axefrog cool, i’ll open a new issue about settling the second parameter API. i’d also like to add some list tests in for the number implication you described
Oh you want watching?
“gulp watch --pkg list”