Socket
Socket
Sign inDemoInstall

xtend

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

2

package.json
{
"name": "xtend",
"version": "2.0.1",
"version": "2.0.2",
"description": "extend like a boss",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -9,56 +9,14 @@ # xtend

Basic usage:
<a href="https://runnable.com/#raynos/xtend-basic/app.js/launch" target="_blank"><img src="https://runnable.com/external/styles/assets/runnablebtn.png" style="width:67px;height:25px;"></a>
```js
var extend = require("xtend")
var extend = require('xtend'),
a = {
'I': 'am'
},
b = {
'a': 'boss'
};
var combination = extend({
a: "a"
}, {
b: "b"
})
// { a: "a", b: "b" }
```
extend(a, b);
console.log('I ', a.I, ' a ', a.a);
Extend with multiple objects:
<a href="https://runnable.com/#raynos/xtend-multiple/app.js/launch" target="_blank"><img src="https://runnable.com/external/styles/assets/runnablebtn.png" style="width:67px;height:25px;"></a>
var extend = require('xtend'),
a = {
'w': 'I'
},
b = {
'x': 'am'
},
c = {
'y': 'a'
},
d = {
'z': 'boss'
}
boss = extend({}, a, b, c, d);
console.log(boss.w, ' ', boss.x, ' ', boss.y, ' ', boss.z);
Right-most precendence:
<a href="https://runnable.com/#raynos/xtend-rightmost/app.js/launch" target="_blank"><img src="https://runnable.com/external/styles/assets/runnablebtn.png" style="width:67px;height:25px;"></a>
var extend = require("xtend"),
a = {
"p": 1
},
b = {
"p": 2
}
c = {
"p": 3
},
boss = extend({}, a, b, c);
console.log(boss.p); // Logs 3
## MIT Licenced
## MIT Licenced
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc