Socket
Socket
Sign inDemoInstall

extend-shallow

Package Overview
Dependencies
4
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 3.0.2

26

index.js
'use strict';
var isExtendable = require('is-extendable');
var assignSymbols = require('assign-symbols');
module.exports = Object.assign || function(obj/*, objects*/) {
if (obj === null || typeof obj === 'undefined') {
throw new TypeError('expected an object');
throw new TypeError('Cannot convert undefined or null to object');
}
if (!isObject(obj)) {
obj = {};
}
for (var i = 1; i < arguments.length; i++) {
var val = arguments[i];
if (isString(val)) {
val = toObject(val);
}
if (isObject(val)) {
assign(obj, val);
assignSymbols(obj, val);
}

@@ -26,2 +34,14 @@ }

function isString(val) {
return (val && typeof val === 'string');
}
function toObject(str) {
var obj = {};
for (var i in str) {
obj[i] = str[i];
}
return obj;
}
function isObject(val) {

@@ -38,1 +58,5 @@ return (val && typeof val === 'object') || isExtendable(val);

}
function isEnum(obj, key) {
return Object.prototype.propertyIsEnumerable.call(obj, key);
}

3

package.json
{
"name": "extend-shallow",
"description": "Extend an object with the properties of additional objects. node.js/javascript util.",
"version": "3.0.1",
"version": "3.0.2",
"homepage": "https://github.com/jonschlinkert/extend-shallow",

@@ -27,2 +27,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"assign-symbols": "^1.0.0",
"is-extendable": "^1.0.1"

@@ -29,0 +30,0 @@ },

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