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

bcore

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bcore - npm Package Compare versions

Comparing version 0.0.20 to 0.0.21

.idea/.name

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Core JavaScript library for browser runtime",
"version": "0.0.20",
"version": "0.0.21",
"author": {

@@ -8,0 +8,0 @@ "name": "fish"

@@ -124,2 +124,45 @@ /**

function deepMergeWithoutArray(dest, src, directs, depth) {
var i, j, len, src, depth = depth || 0;
var result = clone(dest);
if (depth >= maxDepth) {
console.log('层数过深, 全部继承');
return src;
}
depth++;
//
for (i in src) {
if (src.hasOwnProperty(i)) {
var value = src[i];
var destValue = dest[i];
if(value === destValue) continue;
if(value === undefined) continue;
if (destValue && typeof (destValue) === 'object' && typeof (value) === 'object') {
if (Array.isArray(destValue) && Array.isArray(value)) {
result[i] = value;
continue;
}
if (!isNeedClone(value) || (directs && i in directs)) {
result[i] = value;
continue;
}
if (Array.isArray(destValue) !== Array.isArray(value)) { // 继承和被继承的 一个是数组 一个是对象
value = deepClone(value);
result[i] = value;
continue;
}
result[i] = deepMergeWithoutArray(destValue, value, directs, depth);
continue;
}
if (typeof (value) === 'object' && isNeedClone(value)) value = deepClone(value);
result[i] = value;
}
}
return result;
}
/**

@@ -178,3 +221,4 @@ * switchValue 如果是非函数 返回本身 如果是函数 执行之,常用于options内部的判断

'deepClone': deepClone,
'switchValue': switchValue
'switchValue': switchValue,
'deepMergeWithoutArray': deepMergeWithoutArray
};
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