New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ntils

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ntils - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

38

index.js

@@ -415,10 +415,42 @@ (function (owner) {

owner.map = function (list, fn) {
var buffer = [];
var buffer = this.isArray(list) ? [] : {};
this.each(list, function (name, value) {
buffer.push(fn(name, value));
buffer[name](fn(name, value));
});
return [];
return buffer;
};
/**
* 通过路径设置属性值
*/
owner.setByPath = function (obj, path, value) {
if (this.isNull(obj) || this.isNull(path) || path === '') {
return;
}
if (!this.isArray(path)) path = path.split('.');
path.forEach((name, index) => {
if (index === path.length - 1) {
obj[name] = value;
} else {
obj[name] = obj[name] || {};
obj = obj[name];
}
});
};
/**
* 通过路径获取属性值
*/
owner.getByPath = function (obj, path) {
if (this.isNull(obj) || this.isNull(path) || path === '') {
return obj;
}
if (!this.isArray(path)) path = path.split('.');
path.forEach(name => {
if (!this.isNull(obj)) obj = obj[name];
});
return obj;
};
/**
* 数组去重

@@ -425,0 +457,0 @@ **/

2

package.json
{
"name": "ntils",
"version": "1.0.2",
"version": "1.0.3",
"description": "一个 Node & Browser 工具函数集",

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

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