Icepick

node v5.12.0
version: master
endpointsharetweet
const i = require("icepick"); const base = i.freeze({ a: { foo: 'bar' } });
`i.merge` returns the old object if there are no changes
base === i.merge(base, { a: { foo: 'bar' } })
`i.merge` doesn't remove properties when passed `undefined` as value
i.merge({ foo: { bar: 'bar', baz: 'baz' } }, { foo: { bar: void 0} });
`i.assign` always creates new object! *It doesn't I have no idea why this code still returns `false`, there must be some caching.*
base === i.assign(base, {})
`i.updateIn` creates path when it doesn't exist
i.updateIn({ foo: {} }, [ 'foo', 'bar', 'baz' ], () => true)
`i.dissoc` chains properly
i.chain({ foo: 'FOO', bar: 'BAR' }) .dissoc('foo') .assoc('baz', 'BAZ') .value()
`i.assoc` sets array values too
i.assoc([], 1, 'foo')
`i.updateIn` returns an array when modifying it
i.updateIn(['foo', 'bar', 'baz'], [1], () => 'NEW')
Loading…

no comments

    sign in to comment