Releases: refractproject/minim
0.23.8
Enhancements
ArrayElement'scontainsmethod has been renamed toincludesto be consistent withArray.includes.ArrayElement.containshas been deprecated, and remains for compatibility.
Bug Fixes
- Prevent throwing an error when calling
toValue()on an element with a key value pair which does not have a value.
0.23.7
Bug Fixes
- Prevents the JSON serializer from serializing an empty object (
{}) under meta and attributes under the case where none of the meta or attribute member's have a value. This prevents{}from being present under meta or attributes when setting a member with an undefined key.
0.23.6
0.23.4
0.23.2
0.23.1
0.23.0
Breaking
- Support for Node 4 has been removed. Minim now supports Node >= 6.
- Minim no longer uses uptown and thus the
extendAPI has been removed.
Enhancements
- Calling
.freeze()on a frozen element is now supported. Previously you may see an error thrown while freeze was trying to attach parents to any child elements.
0.22.0
Enhancements
ArrayElementnow conforms to parts of the Fantasy
Land 3.5 specification.
Functor,Semigroup,Monoid,Filterable,Chain, andFoldableare
now supported.
0.21.1
0.21.0
Breaking
-
Minim no longer supports importing files directly from the minim package.
Importing the JSON 0.6 serialiser via
require('minim/lib/serialisers/json-0.6')is not supported, it is now
recommended to importJSON06Serialiserand other APIs from minim directly.const { JSON06Serialiser } = require('minim');
-
flatMapinArraySliceno longer removes empty items. InsteadflatMapis
aligned with
Array.flatMap
which first maps each element using a mapping function, then flattens the
result into a new array.Existing
flatMapbehaviour is now available under the methodcompactMap.
Enhancements
-
Object Element can now be created with an array of member elements.
-
You can now create an element from an ArraySlice or ObjectSlice, for example,
passing the result of afilteroperation into a new element.const numbers = new ArrayElement([1, 2, 3, 4]) new ArrayElement(numbers.filter((e) => e.toValue() % 2)) -
Adds
compactMapfunctionality to Array and Object elements allowing you to
returns an array containing the truthy results of calling the given
transformation with each element of this sequence. -
Added
flatMaptoArrayElement.
Bug Fixes
-
The default content value of an element is undefined. Whereas before the
default value wasnull. -
Setting the
contentproperty on an Element now behaves the same as passing
content in to the constructor. For example, the following two elements are
identical:new ArrayElement([1]) const element = new ArrayElement() element.content = [1]
Passing
[1]to anArrayElementconstructor would produce an array of
number elements, whereas setting the content to[1]resulted in setting the
content to be an array of non-elements which is invalid. -
The serialisation of the
variableattribute in the JSON 0.6 serialisation
is updated to reflect API Elements 1.0. Thevariableattribute is now
present on a member element instead of the key of a member element. -
Empty arrays are no longer serialised in JSON 06 Serialiser.