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

mixin-deep

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixin-deep - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

44

index.js
'use strict';
var isObject = require('is-plain-object');
var forOwn = require('for-own');
var lazy = require('lazy-cache')(require);
lazy('is-extendable', 'isExtendable');
lazy('for-in', 'forIn');
function mixinDeep(o, objects) {
if (!isObject(o)) return {};
if (!isObject(objects)) return o;
// don't slice args for v8 optimizations
var len = arguments.length - 1;
for (var i = 0; i < len; i++) {
var obj = arguments[i + 1];
function mixinDeep(target, objects) {
var len = arguments.length, i = 0;
while (++i < len) {
var obj = arguments[i];
if (isObject(obj)) {
forOwn(obj, copy, o);
lazy.forIn(obj, copy, target);
}
}
return o;
return target;
}
/**
* copy properties from the source object to the
* Copy properties from the source object to the
* target object.
*
* @param {*} `value`
* @param {*} `val`
* @param {String} `key`
*/
function copy(value, key) {
function copy(val, key) {
var obj = this[key];
if (isObject(value) && isObject(obj)) {
mixinDeep(obj, value);
if (isObject(val) && isObject(obj)) {
mixinDeep(obj, val);
} else {
this[key] = value;
this[key] = val;
}

@@ -39,2 +36,13 @@ }

/**
* Returns true if `val` is an object or function.
*
* @param {any} val
* @return {Boolean}
*/
function isObject(val) {
return lazy.isExtendable(val) && !Array.isArray(val);
}
/**
* Expose `mixinDeep`

@@ -41,0 +49,0 @@ */

{
"name": "mixin-deep",
"description": "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.",
"version": "1.1.1",
"version": "1.1.2",
"homepage": "https://github.com/jonschlinkert/mixin-deep",

@@ -23,8 +23,9 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"for-own": "^0.1.3",
"is-plain-object": "^2.0.0"
"for-in": "^0.1.4",
"is-extendable": "^0.1.1",
"lazy-cache": "^0.2.3"
},
"devDependencies": {
"mocha": "^2.2.4",
"should": "^6.0.1"
"mocha": "*",
"should": "*"
},

@@ -43,3 +44,13 @@ "keywords": [

"values"
]
],
"verbiage": {
"related": {
"list": [
"mixin-object",
"merge-deep",
"extend-shallow",
"defaults-deep"
]
}
}
}
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