diction-extract
v0.2.1
Published
Extract specific data from dictionaries
Downloads
1
Maintainers
Readme
Diction-extract
Used to convert data from an API to internal structure.
$ npm install --save diction-extract
# or
$ yarn add diction-extract
import Convertion from 'diction-extract';
const conv = new Convertion();
conv.associate('name', 'title');
conv.associate('date', 'release');
const data = {
name: 'track',
date: 2015,
};
const result = conv.convert(data);
expect(result.title).to.equal('track');
expect(result.release).to.equal(2015);
const renew = conv.rollback(result);
// renew == data;
Distributed under MIT - Jensen Bernard