Package Exports
- defu
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (defu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
🇩 defu
Recursively assign default properties. Lightweight and Fast!
Install
Install package:
npm install defu
OR
yarn add defu
Usage
const options = defu (object, ...defaults)
Most left arguments have more perioriry when assigning defaults.
Arguments
- object (Object): The destination object.
- source (Object): The source object.
const defu = require('defu')
console.log(defu({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }))
// => { a: { b: 2, c: 3 } }
Remarks
object
anddefaults
are not modifiednull
values are skipped same as defaults-deep. Please use either omit-deep or lodash.defaultsdeep if you need to to preserve.- Assignment of
__proto__
andconstructor
keys will be skipped to prevent security issues with object pollution.
License
MIT. Made with 💖