1.0.0 • Published 5 years ago

soft-extend v1.0.0

Weekly downloads
5
License
unlicensed
Repository
github
Last release
5 years ago

Soft-extend

Extend any object softly, i. e. do not replace existing properties, just append the new ones.

var sextend = require('soft-extend');

var defaults = {
	intensity: 100,
	hold: true,
	coords: {
		x: 0,
		y: 0
	},
	data: [1, 2, 3]
}

//the very common use-case
function MyClass(options){
	this.options = sextend(options || {}, defaults);
}

NPM

1.0.0

5 years ago

0.1.3

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago