mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
chore(util) add " "
This commit is contained in:
parent
28f6adc751
commit
e8837d05de
1 changed files with 10 additions and 9 deletions
19
lib/util.js
19
lib/util.js
|
|
@ -350,20 +350,20 @@
|
|||
* @param pStr2
|
||||
*/
|
||||
this.strCmp = function(pStr1, pStr2) {
|
||||
var lRet = Util.isString(pStr1);
|
||||
var i, n,
|
||||
lRet = Util.isString(pStr1);
|
||||
|
||||
if (lRet) {
|
||||
if ( Util.isArray(pStr2) )
|
||||
for(var i = 0, n = pStr2.length; i < n; i++) {
|
||||
lRet = Util.strCmp( pStr1, pStr2[i] );
|
||||
if (lRet)
|
||||
if (Util.isArray(pStr2))
|
||||
for (i = 0, n = pStr2.length; i < n; i++) {
|
||||
lRet = Util.strCmp(pStr1, pStr2[i]);
|
||||
|
||||
if (lRet)
|
||||
break;
|
||||
}
|
||||
else if ( Util.isString(pStr2) )
|
||||
else if (Util.isString(pStr2))
|
||||
lRet = Util.isContainStr(pStr1, pStr2) &&
|
||||
pStr1.length === pStr2.length;
|
||||
}
|
||||
|
||||
return lRet;
|
||||
|
||||
|
|
@ -581,9 +581,10 @@
|
|||
|
||||
|
||||
this.escapeRegExp = function(pStr) {
|
||||
var lRet = pStr;
|
||||
var lRet = pStr,
|
||||
isStr = Util.isString(pStr);
|
||||
|
||||
if ( Util.isString(pStr) )
|
||||
if (isStr)
|
||||
lRet = pStr.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
||||
|
||||
return lRet;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue