clay-normalizer
Normalizer for clay-collection
Installation
$ npm install clay-normalizer --save
Usage
'use strict' const clayEntity = const normalize denormalize = let org01 = let user01 = let user02 = let pointers pointed relations = console // -> [ 'User#1', 'User#2' ] console // -> { User: { '1': { /* ... */ }, '2': { /* ... */ } }, Org: { '1': { /* ... */ } } } console // -> { 'User#1': { org: 'Org#1' }, 'User#2': { org: 'Org#1' } } let users = console // -> [ { /* ... */ }, { /* ... */ } ]
Functions
Available functions
Signature | Description |
---|---|
denormalize(normalized, options) -> ClayEntity[] |
Restore from normalized |
normalize(collection, options) -> ClayNormalized |
Normalize clay entities |
License
This software is released under the Apache-2.0 License.