Releases: refractproject/minim
0.23.8
Enhancements
ArrayElement
'scontains
method has been renamed toincludes
to be consistent withArray.includes
.ArrayElement.contains
has 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
extend
API 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
ArrayElement
now conforms to parts of the Fantasy
Land 3.5 specification.
Functor
,Semigroup
,Monoid
,Filterable
,Chain
, andFoldable
are
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 importJSON06Serialiser
and other APIs from minim directly.const { JSON06Serialiser } = require('minim');
-
flatMap
inArraySlice
no longer removes empty items. InsteadflatMap
is
aligned with
Array.flatMap
which first maps each element using a mapping function, then flattens the
result into a new array.Existing
flatMap
behaviour 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 afilter
operation into a new element.const numbers = new ArrayElement([1, 2, 3, 4]) new ArrayElement(numbers.filter((e) => e.toValue() % 2))
-
Adds
compactMap
functionality 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
flatMap
toArrayElement
.
Bug Fixes
-
The default content value of an element is undefined. Whereas before the
default value wasnull
. -
Setting the
content
property 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 anArrayElement
constructor 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
variable
attribute in the JSON 0.6 serialisation
is updated to reflect API Elements 1.0. Thevariable
attribute 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.