0.0.1 • Published 4 years ago

pick-original v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

pick-original

build status code coverage code style styled with prettier made with lass license npm downloads

Transform an Object that was transformed to return only the original properties recursively picked if they are not undefined.

Table of Contents

Install

npm:

npm install pick-original

yarn:

yarn add pick-original

Usage

const pickOriginal = require('pick-original');

function createObj(doc) {
  doc.id = Date.now().toString();
  return doc;
}

const original = { foo: 'bar' };

const transformed = pickOriginal(createObj(original), original);

console.log(transformed);

// { foo: 'bar' }

Contributors

NameWebsite
Nick Baughhttp://niftylettuce.com/

License

MIT © Nick Baugh