From 68ab0bafe6c52522b52876d829ef21ad1cc3f92d Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Wed, 25 May 2016 23:29:45 +0100 Subject: [PATCH] Add param to choose globals --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9d2a77d..7360849 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,13 @@ import { jsdom } from 'jsdom'; -module.exports = () => { +module.exports = (props) => { const window = jsdom('').defaultView; Object.keys(window).forEach(prop => { if(typeof global[prop] === 'undefined') { + if(props instanceof Array && props.indexOf(prop) === -1) { + return; + } global[prop] = window[prop]; } });