Skip to content

Commit

Permalink
remove trailing whitespace, fix two jshint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyd committed Jan 17, 2014
1 parent 91ca3a0 commit ee89123
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/jsonselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* optional array of values. When provided, they will be escaped and
* inserted into the selector string properly escaped. i.e.:
*
* .match(':has(?)', [ 'foo' ], {})
*
* .match(':has(?)', [ 'foo' ], {})
*
* would result in the seclector ':has("foo")' being matched against {}.
*
* This feature makes dynamically generated selectors more readable.
Expand All @@ -26,9 +26,9 @@
* .forEach(selector, [ values ], object, callback)
*
* Like match, but rather than returning an array, invokes the provided
* callback once per match as the matches are discovered.
*
* .compile(selector, [ values ])
* callback once per match as the matches are discovered.
*
* .compile(selector, [ values ])
*
* Parses the selector and compiles it to an internal form, and returns
* an object which contains the compiled selector and has two properties:
Expand All @@ -37,7 +37,7 @@
* use the compiled selector.
*
* For cases where a complex selector is repeatedly used, this method
* should be faster as it will avoid recompiling the selector each time.
* should be faster as it will avoid recompiling the selector each time.
*/
(function(exports) {

Expand Down Expand Up @@ -110,7 +110,7 @@
// (8) bogus JSON strings missing a trailing quote
"(\\\")|" +
// (9) identifiers (unquoted)
"\\.((?:[_a-zA-Z]|[^\\0-\\0177]|\\\\[^\\r\\n\\f0-9a-fA-F])(?:[\$_a-zA-Z0-9\\-]|[^\\u0000-\\u0177]|(?:\\\\[^\\r\\n\\f0-9a-fA-F]))*)" +
"\\.((?:[_a-zA-Z]|[^\\0-\\0177]|\\\\[^\\r\\n\\f0-9a-fA-F])(?:[\\$_a-zA-Z0-9\\-]|[^\\u0000-\\u0177]|(?:\\\\[^\\r\\n\\f0-9a-fA-F]))*)" +
")"
);

Expand Down Expand Up @@ -140,7 +140,7 @@
// skip and don't capture leading whitespace
"^\\s*(?:" +
// (1) simple vals
"(true|false|null)|" +
"(true|false|null)|" +
// (2) numbers
"(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|" +
// (3) strings
Expand Down Expand Up @@ -256,7 +256,7 @@
if (!nested) hints = {};

var a = [], am, readParen;
if (!off) off = 0;
if (!off) off = 0;

while (true) {
var s = parse_selector(str, off, hints);
Expand Down Expand Up @@ -543,7 +543,7 @@
});
if (arr.length) throw "too many parameters supplied";
return sel;
}
}

function compile(sel, arr) {
if (arr) sel = format(sel, arr);
Expand All @@ -565,7 +565,7 @@
return compile(sel, arr).match(obj);
};
exports.forEach = function(sel, arr, obj, fun) {
if (!fun) { fun = obj; obj = arr; arr = undefined }
if (!fun) { fun = obj; obj = arr; arr = undefined; }
return compile(sel, arr).forEach(obj, fun);
};
exports.compile = compile;
Expand Down

0 comments on commit ee89123

Please sign in to comment.