Connection: change style for hasNonASCII()

fork
Brian White 11 years ago
parent d028aadfca
commit 69a9031d7c

@ -1593,6 +1593,7 @@ module.exports = Connection;
function escape(str) {
return str.replace(RE_BACKSLASH, '\\\\').replace(RE_DBLQUOTE, '\\"');
}
function validateUIDList(uids, noThrow) {
for (var i = 0, len = uids.length, intval; i < len; ++i) {
if (typeof uids[i] === 'string') {
@ -1615,16 +1616,15 @@ function validateUIDList(uids, noThrow) {
uids[i] = intval;
}
}
function hasNonASCII(str) {
var ret = false;
for (var i = 0, len = str.length; i < len; ++i) {
if (str.charCodeAt(i) > 0x7F) {
ret = true;
break;
}
if (str.charCodeAt(i) > 0x7F)
return true;
}
return ret;
return false;
}
function buildString(str) {
if (typeof str !== 'string')
str = ''+str;
@ -1635,6 +1635,7 @@ function buildString(str) {
} else
return '"' + escape(str) + '"';
}
function buildSearchQuery(options, extensions, info, isOrChild) {
var searchargs = '', err, val;
for (var i = 0, len = options.length; i < len; ++i) {

Loading…
Cancel
Save