Browse Source

Fix linting warnings.

pull/73/head
Guillaume Martigny 6 years ago
parent
commit
1f5c9cf901
  1. 7
      src/index.js

7
src/index.js

@ -18,9 +18,8 @@ const protectedproperties = (() => Object
)();
// Sets up global browser environment
const browserEnv = function () {
const browserEnv = function (...args) {
// Extract options from args
const args = Array.from(arguments);
const properties = args.filter(arg => Array.isArray(arg))[0];
const userJsdomConfig = args.filter(arg => !Array.isArray(arg))[0];
@ -31,10 +30,10 @@ const browserEnv = function () {
Object.getOwnPropertyNames(window)
// Remove protected properties
.filter(prop => protectedproperties.indexOf(prop) === -1)
.filter(prop => !protectedproperties.includes(prop))
// If we're only applying specific required properties remove everything else
.filter(prop => !(properties && properties.indexOf(prop) === -1))
.filter(prop => !properties || properties.includes(prop))
// Copy what's left to the Node.js global scope
.forEach(prop => {

Loading…
Cancel
Save