UNPKG

browser-monads

Version:

Interface for the `window` and `document` variables of a webpage.

14 lines (11 loc) 388 B
'use strict'; var _require = require('nothing-mock'), Nothing = _require.Nothing, isNothing = _require.isNothing; var win = typeof window !== 'undefined' ? window : Nothing; var doc = typeof document !== 'undefined' ? document : Nothing; module.exports.window = win; module.exports.document = doc; module.exports.exists = function (variable) { return !isNothing(variable); };