first commit
This commit is contained in:
21
bootstrap/node_modules/component-query/index.js
generated
vendored
Normal file
21
bootstrap/node_modules/component-query/index.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
function one(selector, el) {
|
||||
return el.querySelector(selector);
|
||||
}
|
||||
|
||||
exports = module.exports = function(selector, el){
|
||||
el = el || document;
|
||||
return one(selector, el);
|
||||
};
|
||||
|
||||
exports.all = function(selector, el){
|
||||
el = el || document;
|
||||
return el.querySelectorAll(selector);
|
||||
};
|
||||
|
||||
exports.engine = function(obj){
|
||||
if (!obj.one) throw new Error('.one callback required');
|
||||
if (!obj.all) throw new Error('.all callback required');
|
||||
one = obj.one;
|
||||
exports.all = obj.all;
|
||||
return exports;
|
||||
};
|
Reference in New Issue
Block a user