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 4.0.0 to 4.0.1

4

immutable.js
module.exports = extend
var hasOwnProperty = Object.prototype.hasOwnProperty;
function extend() {

@@ -10,3 +12,3 @@ var target = {}

for (var key in source) {
if (source.hasOwnProperty(key)) {
if (hasOwnProperty.call(source, key)) {
target[key] = source[key]

@@ -13,0 +15,0 @@ }

module.exports = extend
var hasOwnProperty = Object.prototype.hasOwnProperty;
function extend(target) {

@@ -8,3 +10,3 @@ for (var i = 1; i < arguments.length; i++) {

for (var key in source) {
if (source.hasOwnProperty(key)) {
if (hasOwnProperty.call(source, key)) {
target[key] = source[key]

@@ -11,0 +13,0 @@ }

{
"name": "xtend",
"version": "4.0.0",
"version": "4.0.1",
"description": "extend like a boss",

@@ -36,8 +36,3 @@ "keywords": [

},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/raynos/xtend/raw/master/LICENSE"
}
],
"license": "MIT",
"testling": {

@@ -44,0 +39,0 @@ "files": "test.js",

@@ -64,1 +64,21 @@ var test = require("tape")

})
test("null prototype", function(assert) {
var a = { a: "foo" }
var b = Object.create(null)
b.b = "bar";
assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
assert.end()
})
test("null prototype mutable", function (assert) {
var a = { foo: "bar" }
var b = Object.create(null)
b.bar = "baz";
mutableExtend(a, b)
assert.equal(a.bar, "baz")
assert.end()
})
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