Skip to content

Releases: 92green/unmutable

Unmutable Compatible filter, filterNot, map, reduce

24 Oct 01:17
Compare
Choose a tag to compare
  • Feat: make filter, filterNot, map and reduce able to be called on unmutable compatible data, and remove record specific implementations
    • You'll need to define entries(), set() and delete() on your unmutable compatible data type
  • Fixed shallowToJS, internal name was wrong
  • Refactor: restore previous shallowToJS logic that can cope with non array non object types
  • Refactor: make keys and values use entries internally
  • Add unmutable compatible tests to identify base functions for UnmutableCompatible types
  • Test: allow unmutable compatible tests to check clear, clone and delete
  • No breaking changes

Add move, rotate, takeUntil, takeWhile, skipUntil, skipWhile, toJSON, chunk, chunkBy, deal, isWriteable

21 Oct 22:21
Compare
Choose a tag to compare
  • Add move #81
  • Add rotate #69
  • Add takeUntil
  • Add takeWhile
  • Add skipUntil
  • Add skipWhile
  • Add toJSON
  • Add chunk #75
  • Add chunkBy #75
  • Add deal #70
  • Add isWriteable
  • Add treeshakeable ES6 named exports #82
  • Add util files to src directory for standardised importing
  • Add immutablility test for immutable.js compatible functions
  • Fix findIndex on array was not passing iter
  • No breaking changes

Add experimental support for "unmutable compatible" data types

25 Sep 04:03
Compare
Choose a tag to compare
  • Experimental support has been added for custom data types, such as classes that you may write yourself. For a class instance to be unmutable compatible, it must have a key of __UNMUTABLE_COMPATIBLE__ and set this to true. When unmutable finds this key on a value, it will try to call a method on that value and pass all arguments through. It is up to you to write the behaviour of each of the methods that unmutable may call on your class, and to ensure these behave immutably. If a method cannot be found on the value, and if a type-agnostic execution for the current function already exists in unmutable (this is a function called "all" in the unmutable source code), then unmutable will use the type-agnostic function instead. This means that by implementing a few basic methods like has, get, set, delete, entries etc, you should also be able to use unmutable functions such as getIn, update, find etc.
  • No breaking changes

Perf: Speed up get, set, has, update

21 Sep 04:36
Compare
Choose a tag to compare

Add mergeDeep, mergeDeepIn, mergeDeepWith, mergeIn, mergeWith

21 Sep 04:35
Compare
Choose a tag to compare
  • Add mergeDeep
  • Add mergeDeepIn
  • Add mergeDeepWith
  • Add mergeIn
  • Add mergeWith
  • Fix view-coverage command
  • No breaking changes

Fix: Make has() work on getters on class instances and inherited properties

03 Sep 06:37
Compare
Choose a tag to compare
  • Fix: Make has() work on getters on class instances and inherited properties
  • No breaking changes

Add splice, indexOf, lastIndexOf, flatten, setSize, max, maxBy, min, minBy

23 Aug 05:25
Compare
Choose a tag to compare
  • Add splice
  • Add indexOf
  • Add lastIndexOf
  • Add flatten
  • Add setSize (courtesy of @mriccid)
  • Add max
  • Add maxBy
  • Add min
  • Add minBy
  • No breaking changes

Add forEach(), groupBy(), hashCode(), includes(), notEquals(), unique(), uniqueBy()

20 Aug 03:33
Compare
Choose a tag to compare



  • Add forEach()
  • Add groupBy()
    • object and arrays cannot be grouped on deeply equal keys because plain objects cannot have objects as keys
  • Add hashCode()
    • non-Immutable.js values are JSON stringified
  • Add includes()
  • Add notEquals()
  • Add unique() (#51)
  • Add uniqueBy() (#51)
  • No breaking changes

Add util/range(), change util/overload()

20 Aug 03:15
Compare
Choose a tag to compare
  • Add util/range, a re-export of lodash.range
  • BREAKING CHANGE util/overload no longer has a concept of innerArgs. It now only accepts a single argument, and each function on the overloads object needs to be (...args) => result, rather than (...innerArgs) => (...args) => result

Support for class instances and functions as values, added isObject()

03 Aug 00:33
Compare
Choose a tag to compare

Experimental support for class instances and functions being passed as values has been added. They are treated in the same way as plain objects are. Currently these should work with methods that don't make changes to the data structure (get, getIn, find etc.) There are plans for a standard API that unmutable can use with methods that make data changes.

Behaviour change is exemplified by these two tests:

test('get() on class instance should work', (t: *) => {
    class A {
        foo = 'bar';
    }
    t.is(get('foo')(new A()), 'bar');
});

test('get() on function should work', (t: *) => {
    let fn = () => {};
    fn.foo = 'bar';
    t.is(get('foo')(fn), 'bar');
});

Also added unmutable/lib/util/isObject, which returns true for all non-primitives including arrays.