map-factory
Advanced tools
Comparing version 1.2.2 to 1.2.3
{ | ||
"name": "map-factory", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Object mapping tool", | ||
@@ -5,0 +5,0 @@ "main": "./dist/lib/index.js", |
@@ -16,6 +16,6 @@ # map-factory | ||
#### Examples | ||
- [Mapping data to a new structure](#mapping) | ||
- [Working with arrays](#arrays) | ||
- [Transformations](#transforms) | ||
- [Working with multiple source objects](#multisource) | ||
- [Mapping data to a new structure](#mapping-data-to-a-new-structure) | ||
- [Working with arrays](#working-with-arrays) | ||
- [Transformations](#transformations) | ||
- [Working with multiple source objects](#dealing-with-multiple-sources-of-data) | ||
@@ -62,5 +62,3 @@ See [Change Log](./CHANGELOG.md) for changes from previous versions. | ||
<a name="mapping"> | ||
### Mapping data to a new structure | ||
</a> | ||
@@ -116,5 +114,3 @@ **map-factory** supports deep object references for both source and target fields via dot notation. Mapping is explicit so unmapped fields are discarded. | ||
``` | ||
<a name="arrays"> | ||
### Working with arrays | ||
</a> | ||
You can use ```[]``` to traverse the entries in an array. For example, here you can transform an array of objects to an array of strings. | ||
@@ -198,5 +194,3 @@ | ||
``` | ||
<a name="transforms"> | ||
### Transformations | ||
</a> | ||
More complicated transformations can be handled by providing a function. The selected source data will be passed to the function. | ||
@@ -288,5 +282,3 @@ | ||
## Common patterns | ||
<a name="multisource"> | ||
### Dealing with multiple sources of data | ||
</a> | ||
There are two ways to deal with multiple sources of data. | ||
@@ -293,0 +285,0 @@ - Combine your data in to a single object before mapping |
67365
493