cleans

1.1.0 • Public • Published

cleans

Build Status

A tool for cleaning up js objects

const cleans = require('cleans')

const obj = {
  a:'bar',
  b: {
    c: 5,
    d: "stuff"
  },
  e: [{
    f: 2
  }]
}

cleans(obj)
  .delete('a')
  .delete('b.d')
  .map('b.c', x => x * 2)
  .map('e.f', x => 'hello')


console.log(obj)

{
  b: {
    c: 10
  },
  e: [{
    f: 'hello'
  }]
}

Readme

Keywords

none

Package Sidebar

Install

npm i cleans

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • benjaminbenben