circle-assign
v2.0.0
Published
Simple deep object assign function
Downloads
35
Maintainers
Readme
circle-assign
circle-assign is a simple deep object assign function and can be used in nodejs and the browser
Installation
$ npm install --save circle-assign
Syntax
circleAssign(target, ...sources)
Usage
NodeJS
const circleAssign = require('circle-assign');
Browser (ES6)
import circleAssign from 'circle-assign';
Browser (CDN)
<script
type="application/javascript"
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/circle-assign.min.js"
/>
const a = {
language: 'javascript',
features: {
recursive: true,
size: 'small'
}
};
const b = {
language: 'JavaScript',
opensource: true,
features: {
size: '~1.3kb',
canMergeFunctions: true
}
};
const c = {
coolFunc: () => {
console.log('Much wow');
}
};
console.log(circleAssign(a, b, c));
Output
{
language: "JavaScript",
opensource: true,
features: {
recursive: true,
size: "~1.3kb",
canMergeFunctions: true
},
coolFunc: () => {
console.log('Much wow');
}
}