typed-assign
v0.1.1
Published
object assing if type mismatch
Readme
typed-assign
Object.assingn, Overwrite when TYPE mismatch
Install
$ npm install typed-assignUsage
const typedAssign = require('typed-assign');
typedAssign({ foo: 1 }, { bar: 1 })
//=> { foo:1 ,bar: 1 }
typedAssign({ foo: 'hello' }, { foo: 1 })
// => { foo: 1 }
typedAssign({ foo: [] }, { foo: {} })
// => { foo: {} }
typedAssign({ foo: 0 }, { bar: 'hello' }, { bar: 2 })
// => { foo: 0, bar: 1 }API
typedAssign(target: Object, ...sources: Object[])
Assigns enumerable own properties of source objects to the target object and returns the target object. Additional source objects will overwrite previous ones.
Contributors
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
License
MIT © akameco
