Releases: russmatney/super-object-mapper
updated object-mapper dep
No breaking changes
closure to select mapper
no breaking changes.
0.4.0: Merge pull request #5 from russmatney/tighter-map-object-api
Moves api from mapObject(map, mapper, object) to mapObject(object, {map: map, mapper: mapper})
Data types and conversions
First iteration for setting explicit data-types and tranformers. Exposes SuperOM.Type, provides conversion to string or objectId via .string()
or .objectId()
.
refactor -> cleaner tests, more readable implementation
Merge pull request #2 from russmatney/refactor-tests-and-lib Refactor tests and lib
Array and null handling
Handing an Array of objects to mapObject
will apply the specified mapper to every object in that array, and return the mapped array.
Unless {clean: true}
is specified in the options, all falsy values are stripped from the mappedObject EXCEPT those that are explicitly set on the original object. the node-object-mapper used under the hood likes to set everything to null
, which could be a problem if you don't want to wipe all the non-specified data away with a partial update to a database.
Initial Release
Instances share mappers, .addMapper(mapper, mapperName)
and .mapObject(mapName, mapperName, object)
implemented and tested.