ladjs / pick-original

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

Home Page:https://lad.js.org

Repository from Github https://github.comladjs/pick-originalRepository from Github https://github.comladjs/pick-original

build status code style styled with prettier made with lass license

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

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
Titanism

License

MIT © Titanism

About

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

https://lad.js.org

License:MIT License


Languages

Language:JavaScript 93.2%Language:Shell 6.8%