Comparing version 1.0.6 to 1.0.7
25
index.js
@@ -449,4 +449,7 @@ (function (owner) { | ||
} | ||
if (!this.isArray(path)) path = path.split('.'); | ||
if (!this.isArray(path)) { | ||
path = path.replace(/\[/, '.').replace(/\]/, '.').split('.'); | ||
} | ||
this.each(path, function (index, name) { | ||
if (this.isNull(name) || name.length < 1) return; | ||
if (index === path.length - 1) { | ||
@@ -468,4 +471,7 @@ obj[name] = value; | ||
} | ||
if (!this.isArray(path)) path = path.split('.'); | ||
if (!this.isArray(path)) { | ||
path = path.replace(/\[/, '.').replace(/\]/, '.').split('.'); | ||
} | ||
this.each(path, function (index, name) { | ||
if (this.isNull(name) || name.length < 1) return; | ||
if (!this.isNull(obj)) obj = obj[name]; | ||
@@ -535,17 +541,2 @@ }, this); | ||
/** | ||
* 异步执行一个函数(模拟多线程) | ||
* @method async | ||
* @param {Function} fn 执行的函数 | ||
* @param {Number} dely 延迟时间(毫秒) | ||
* @static | ||
*/ | ||
owner.async = function (fn, delay) { | ||
if (!this.isFunction(fn)) return; | ||
delay = delay || 0; | ||
if (fn.asyncTimer) clearTimeout(fn.asyncTimer); | ||
fn.asyncTimer = setTimeout(fn, delay); | ||
return fn.asyncTimer; | ||
}; | ||
/** | ||
* 合并对象 | ||
@@ -552,0 +543,0 @@ * @method mix |
{ | ||
"name": "ntils", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "一个 Node & Browser 工具函数集", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
17942
597