Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charliewilco/sanitize-object
https://github.com/charliewilco/sanitize-object
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/charliewilco/sanitize-object
- Owner: charliewilco
- Created: 2018-06-18T07:49:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-10T23:19:56.000Z (about 5 years ago)
- Last Synced: 2024-04-24T00:43:51.117Z (7 months ago)
- Language: TypeScript
- Size: 76.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Sanitize Object
![Build Status](https://github.com/charliewilco/sanitize-object/workflows/nodejs/badge.svg)
When you need a cloned object without the stowaways.
## Install
```
yarn add @charliewilco/sanitize-object
```## Example
```js
const sanitize = require('@charliewilco/sanitize-object')const cloned = sanitize(
{ dateAdded: '2017-11-21T15:57:28.109Z', title: 'Some Entry' },
['dateAdded']
)console.log(cloned)
// Result: { title: 'Some Entry' }
```