Skip to content

Commit 4bb3b45

Browse files
committed
rework exports. in browser it's still window.JSONSelect.XXX. in node, it's now exports.match, rather than exports.JSONSeelct.match
1 parent 621511a commit 4bb3b45

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/jsonselect.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,9 @@
226226
};
227227
}
228228

229-
exports.JSONSelect = {
230-
// expose private API for testing
231-
_lex: lex,
232-
_parse: parse,
233-
// public API
234-
match: function (sel, obj) { return compile(sel).match(obj) },
235-
forEach: function(sel, obj, fun) { return compile(sel).forEach(obj, fun) },
236-
compile: compile
237-
};
238-
})(typeof exports === "undefined" ? window : exports);
229+
exports._lex = lex;
230+
exports._parse = parse;
231+
exports.match = function (sel, obj) { return compile(sel).match(obj) };
232+
exports.forEach = function(sel, obj, fun) { return compile(sel).forEach(obj, fun) };
233+
exports.compile = compile;
234+
})(typeof exports === "undefined" ? (window.JSONSelect = {}) : exports);

0 commit comments

Comments
 (0)