Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "nwsapi", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Fast CSS Selectors API Engine", | ||
@@ -5,0 +5,0 @@ "homepage": "http://javascript.nwbox.com/nwsapi/", |
@@ -8,5 +8,5 @@ /* | ||
* Author: Diego Perini <diego.perini at gmail com> | ||
* Version: 2.0.3 | ||
* Version: 2.0.4 | ||
* Created: 20070722 | ||
* Release: 20180608 | ||
* Release: 20180618 | ||
* | ||
@@ -34,3 +34,3 @@ * License: | ||
var version = 'nwsapi-2.0.3', | ||
var version = 'nwsapi-2.0.4', | ||
@@ -320,10 +320,19 @@ doc = global.document, | ||
function(ids, context) { | ||
var element, resolver, test, reIds; | ||
var e, elements, resolver, test, reIds, api = method['#']; | ||
if (typeof ids == 'string') { ids = [ ids ]; } | ||
// if duplicates are disallowed use DOM API to collect the nodes | ||
if (!Config.IDS_DUPES && ids.length < 2 && method['#'] in context) { | ||
element = context.getElementById(ids[0]); | ||
return element ? [ element ] : none; | ||
if (!Config.IDS_DUPES && ids.length < 2 && context[api]) { | ||
return (e = context[api](ids[0])) ? [ e ] : none; | ||
} else if (Config.IDS_DUPES && ids.length < 2) { | ||
if ('all' in context) { | ||
if ((e = context.all[ids[0]])) { | ||
// bugfixing | ||
if (e.nodeType == 1) return e.getAttribute('id') != ids[0] ? [ ] : [ e ]; | ||
for (i = 0, l = e.length, elements = [ ]; l > i; ++i) { | ||
if (e[i].id == ids[0]) elements[elements.length] = e[i]; | ||
} | ||
return elements && elements.length ? elements : [ elements ]; | ||
} else return none; | ||
} | ||
} | ||
@@ -961,3 +970,3 @@ | ||
expr = match[3].replace(REX.TrimSpaces, ''); | ||
source = 'if(s.match("' + expr.replace(/\x22/g, '\\"') + ',e")){' + source + '}'; | ||
source = 'if(s.match("' + expr.replace(/\x22/g, '\\"') + '",e,f)){' + source + '}'; | ||
break; | ||
@@ -964,0 +973,0 @@ case 'not': |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73694
1644