https://github.com/ladjs/pick-original
Transform an Object that was transformed to return only the original properties recursively picked if they are not undefined.
https://github.com/ladjs/pick-original
Last synced: 2 months ago
JSON representation
Transform an Object that was transformed to return only the original properties recursively picked if they are not undefined.
- Host: GitHub
- URL: https://github.com/ladjs/pick-original
- Owner: ladjs
- License: mit
- Created: 2020-05-30T21:38:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-20T23:44:01.000Z (over 1 year ago)
- Last Synced: 2025-02-03T02:32:29.330Z (11 months ago)
- Language: JavaScript
- Homepage: https://lad.js.org
- Size: 553 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [**@ladjs/pick-original**](https://github.com/ladjs/pick-original)
[](https://github.com/ladjs/pick-original/actions/workflows/ci.yml)
[](https://github.com/sindresorhus/xo)
[](https://github.com/prettier/prettier)
[](https://lass.js.org)
[](LICENSE)
> Transform an Object that was transformed to return only the original properties recursively picked if they are not undefined.
## Table of Contents
* [Install](#install)
* [Usage](#usage)
* [Contributors](#contributors)
* [License](#license)
## Install
[npm][]:
```sh
npm install @ladjs/pick-original
```
## Usage
```js
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](LICENSE) © Titanism
##
[npm]: https://www.npmjs.com/