@ladjs/pick-original

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

Usage no npm install needed!

<script type="module">
  import ladjsPickOriginal from 'https://cdn.skypack.dev/@ladjs/pick-original';
</script>

README

@ladjs/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 @ladjs/pick-original

yarn:

yarn add @ladjs/pick-original

Usage

const pickOriginal = require('@ladjs/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

Name Website
Nick Baugh http://niftylettuce.com/

License

MIT © Nick Baugh