0.2.1 • Published 7 years ago

diction-extract v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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