map-factory
Advanced tools
Changelog
2.0.3
Removed some debugging code that was accidentally left in.
Changelog
2.0.2
Made the babel output ES5 to allow use in the browser.
Changelog
2.0.1
Screwed up with publishing 2.0.0. This fixed that.
Changelog
2.0.0
In v1
the default behaviour was the equivalent of setting the options as {alwaysTransform: true, alwaysSet: true}
. In v2
the default behaviour is now the equivalent of setting the options as {alwaysTransform: false, alwaysSet: false}
.
We feel these are generally better defaults. This is a breaking change.
If you prefer the v1
behaviour you just need to change your code as follows:
const mapper = createMapper();
const options = {
alwaysTransform: true,
alwaysSet: true
};
const mapper = createMapper(options);
Additionally, the v1
behaviour would consider a null an acceptable value if a ?
was appended to the to()
field. In v2
this behaviour will only work in combination with the always
flag.
map("foo.bar").to("bar.bar?");
map("foo.bar").always.to("bar.bar?");
Changelog
1.7.2
Bug-fix to make or mode respect behaviour modifiers.
Changelog
1.7.0
Introduced behaviour modifiers to make map-factory more flexible. See README for more details.
const createMapper = require("map-factory");
const options = {
alwaysTransform: false,
alwaysSet: false
};
const mapper = createMapper(options);
const createMapper = require("map-factory");
const mapper = createMapper(options);
mapper
.map("a").always.to("b")
.map("c").existing.to("d");
Changelog
1.6.3
Set experimental flag to eliminate some of the object-mapper code