Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

just-extend

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-extend - npm Package Compare versions

Comparing version 1.1.26 to 1.1.27

15

index.js

@@ -25,5 +25,6 @@ module.exports = extend;

extend({a: 4, b: 5}); // {a: 4, b: 5}
extend({a: 4, b: 5}, 3); {a: 4, b: 5}
extend({a: 4, b: 5}, true); {a: 4, b: 5}
extend('hello', {a: 4, b: 5}); // throws
extend(3, {a: 4, b: 5}); // throws
extend({a: 4, b: 5}, 3); // throws
extend({a: 4, b: 5}, true); // throws
*/

@@ -37,10 +38,6 @@

}
var arg;
var i = args.length;
while (((arg = args[i - 1]), i--)) {
if (!arg || (typeof arg != 'object' && typeof arg != 'function')) {
throw new Error('expected object, got ' + arg);
}
var result = args[0];
if (!result || (typeof result != 'object' && typeof result != 'function')) {
throw new Error('extendee must be an object');
}
var result = args[0];
var extenders = args.slice(1);

@@ -47,0 +44,0 @@ var len = extenders.length;

2

package.json
{
"name": "just-extend",
"version": "1.1.26",
"version": "1.1.27",
"description": "extend an object",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,26 +11,27 @@ ## just-extend

let obj = {a: 3, b: 5};
var obj = {a: 3, b: 5};
extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
obj; // {a: 4, b: 5, c: 8}
let obj = {a: 3, b: 5};
var obj = {a: 3, b: 5};
extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
obj; // {a: 3, b: 5}
let arr = [1, 2, 3];
let obj = {a: 3, b: 5};
var arr = [1, 2, 3];
var obj = {a: 3, b: 5};
extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
arr.push[4];
arr.push(4);
obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}
let arr = [1, 2, 3];
let obj = {a: 3, b: 5};
var arr = [1, 2, 3];
var obj = {a: 3, b: 5};
extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
arr.push[4];
arr.push(4);
obj; // {a: 3, b: 5, c: [1, 2, 3]}
extend({a: 4, b: 5}); // {a: 4, b: 5}
extend({a: 4, b: 5}, 3); {a: 4, b: 5}
extend({a: 4, b: 5}, true); {a: 4, b: 5}
extend('hello', {a: 4, b: 5}); // throws
extend(3, {a: 4, b: 5}); // throws
extend({a: 4, b: 5}, 3); // throws
extend({a: 4, b: 5}, {b: 4, c: 5}, 'c'); // throws
```
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc