Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/charliewilco/sanitize-object


https://github.com/charliewilco/sanitize-object

Last synced: about 1 month ago
JSON representation

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' }
```