Browse Source

Allow args to be passed through in any order

pull/2/head
Luke Childs 9 years ago
parent
commit
785df853de
  1. 7
      src/index.js

7
src/index.js

@ -8,7 +8,12 @@ const protectedproperties = (() => {
.filter(prop => global[prop]);
})();
module.exports = (properties = false, jsdomConfig = {}) => {
const getType = val => Object.prototype.toString.call(val);
module.exports = (...args) => {
const properties = args.filter(arg => getType(arg) === '[object Array]')[0];
const jsdomConfig = args.filter(arg => getType(arg) === '[object Object]')[0];
const window = jsdom('<html><body></body></html>', jsdomConfig).defaultView;
Object

Loading…
Cancel
Save