node-object-mapper
node-object-mapper copied to clipboard
Copy properties from one object to another.
Greetings, When we've got an array of destination properties and one of them is supposed to return a boolean value (a false one), the rest of the destination properties is...
When trying to map multi-level arrays, as follows: ``` var from = { Items: [ { SubItems: [ { SubKey: 'item 1 id a' }, { SubKey: 'item 1 id...
In my use case, I am dealing with two array that I need to combine into one single array according to some conditional logics: let input = { required: [...
For the below code: var om = require('object-mapper'); var map = { "id": { "key": "destId", "transform": function(id) { return "_" + id; } // , // "default": "0" }...
For more details, please refer to issue: [#39] null as forced default value
How can do a bidirectional mapper?
For further details please refer to the issue: [#41] Handling non-existent sub-array elements of source object
**Background** I often use Object Mapper to create objects that fit a particular schema. When I manage my authored code, I want to clearly see the schema of the object...
I have the following mapper: ``` objectMapper({ name: undefined }, { name: [{ key: 'user.firstName', default: '', transform: (val) => val.split(' ')[0]; }, { key: 'user.lastName', default: '', transform: (val)...
I just saw this gist, I think we could use to improve the lib, what you think? https://gist.github.com/kane-thornwyrd/44fdc43c63eccbd5a057