UNPKG

react-json-verbling

Version:

A JSON editor packed as a React.js component and the simplest way of creating web forms.

13 lines (10 loc) 395 B
module.exports = function(markup) { if (typeof document !== 'undefined') return var jsdom = require("jsdom").jsdom global.document = jsdom(markup || '<!doctype html><html><body></body></html>'); global.window = document.parentWindow; global.navigator = window.navigator = {}; navigator.userAgent = 'NodeJs JsDom'; navigator.appVersion = ''; return document; };