Comparing version 1.1.4 to 1.2.0
41
index.js
@@ -73,9 +73,3 @@ (function (owner) { | ||
if (this.isNull(str1) || this.isNull(str2)) return false; | ||
if (self.isArray(str1)) { | ||
return self.each(str1, function (i, str) { | ||
if (str == str2) return true; | ||
}); | ||
} else { | ||
return str1 && str2 && str1.indexOf(str2) > -1; | ||
} | ||
return str1.indexOf(str2) > -1; | ||
}; | ||
@@ -500,6 +494,4 @@ | ||
var newArray = []; | ||
var map = {}; | ||
this.each(array, function (i, value) { | ||
if (map[value]) return; | ||
map[value] = true; | ||
if (newArray.indexOf(value) > -1) return; | ||
newArray.push(value); | ||
@@ -525,31 +517,2 @@ }); | ||
/** | ||
* 处理URL | ||
* @method wrapUrl | ||
* @param {String} _url 原始URL | ||
* @return {String} 处理过的URL | ||
* @static | ||
*/ | ||
owner.wrapUrl = function (url) { | ||
if (this.isNull(url)) return url; | ||
if (url.indexOf('?') > -1) { | ||
url += "&__t=" + this.newGuid(); | ||
} else { | ||
url += "?__t=" + this.newGuid(); | ||
} | ||
return url; | ||
}; | ||
/** | ||
* 休眼 | ||
* @method sleep | ||
* @param {Number} s 休眠时间(毫秒) | ||
* @static | ||
*/ | ||
owner.sleep = function (s) { | ||
var time = (new Date()).getTime() + s; | ||
while ((new Date()).getTime() + 1 < time); | ||
return; | ||
}; | ||
/** | ||
* 合并对象 | ||
@@ -556,0 +519,0 @@ * @method mix |
{ | ||
"name": "ntils", | ||
"version": "1.1.4", | ||
"version": "1.2.0", | ||
"description": "一个 Node & Browser 工具函数集", | ||
@@ -25,2 +25,2 @@ "main": "index.js", | ||
"homepage": "https://github.com/Houfeng/ntils#readme" | ||
} | ||
} |
17528
574