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

bcore

Package Overview
Dependencies
Maintainers
3
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.4 to 0.0.5

6

event.js

@@ -228,1 +228,7 @@ // Copyright Joyent, Inc. and other Node contributors.

};
EventEmitter.prototype.off = EventEmitter.prototype.removeAllListeners;
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.fire = EventEmitter.prototype.fireEvent = EventEmitter.prototype.emit;
EventEmitter.prototype.clearAllEventListeners = EventEmitter.prototype.removeAllListeners;

2

package.json

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

"description": "Core JavaScript library for browser runtime",
"version": "0.0.4",
"version": "0.0.5",
"author": {

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

@@ -70,13 +70,13 @@ /**

/**
* deepMerge 深度合并
* @param {Object} dest 被合并的对象
* @param {Object} src 发起合并的对象
* @param {Number} depth 合并深度
* @return {Object} 合并结束的对象
*/
function deepMerge(dest, src, depth) {
var i, j, len, src, result = clone(dest), depth = depth || 0;
console.log(depth,'depth')
if(depth++ >= 3) {
function deepClone(src) {
return deepMerge({}, src);
}
var maxDepth = 3;
function deepMerge(dest, src, isDirect, depth) {
var i, j, len, src, depth = depth || 0;
var result = isDirect ? dest : clone(dest);
if (depth++ >= maxDepth) {
console.log('层数过深, 全部继承');

@@ -91,7 +91,8 @@ return clone(src);

if(value === destValue) continue;
if(value === undefined || value === null) continue;
if(value === undefined) continue;
if (destValue && typeof (destValue) === 'object' && typeof (value) === 'object') {
result[i] = deepMerge(destValue, value, depth);
result[i] = deepMerge(destValue, value, isDirect, depth);
continue;
}
if (typeof(value) === 'object' && (!isDirect)) value = deepMerge({}, value, false);
result[i] = value;

@@ -103,9 +104,17 @@ }

function deepMergeCopy(dest, src){
return deepMerge(dest, src, false);
}
function deepMergeDirect(dest, src){
return deepMerge(dest, src, false);
}
module.exports = {
merge: merge,
isNone: isNone,
traver: traver,
deepMerge: deepMerge,
clone: clone
};
'merge': merge,
'isNone': isNone,
'traver': traver,
'deepMerge': deepMerge,
'deepMergeDirect': deepMergeDirect,
'deepMergeCopy': deepMergeCopy,
'clone': clone,
'deepClone': deepClone
};
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