1.1.0 • Published 7 years ago

cleans v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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'
  }]
}
1.1.0

7 years ago

1.0.0

7 years ago