Comparing version 0.3.2 to 0.3.3
@@ -5,15 +5,14 @@ "use strict"; | ||
exports.win = exports.hasWin = exports.doc = void 0; | ||
var _reshowConstant = require("reshow-constant"); | ||
//@ts-check | ||
//@ts-check | ||
var defaultObj = { | ||
__null: true | ||
}; | ||
/** | ||
* @param {object|undefined} w | ||
* @param {object} def | ||
* @param {any} def | ||
* @returns {document} | ||
*/ | ||
var doc = function doc(w, def) { | ||
@@ -23,10 +22,9 @@ if (w === void 0) { | ||
} | ||
if (def === void 0) { | ||
def = defaultObj; | ||
} | ||
var oDoc = (w || win()).document; | ||
return _reshowConstant.UNDEFINED !== typeof oDoc ? oDoc : def; | ||
}; | ||
/** | ||
@@ -36,6 +34,3 @@ * @param {string} key | ||
*/ | ||
exports.doc = doc; | ||
var hasWin = function hasWin(key) { | ||
@@ -45,13 +40,10 @@ if (key === void 0) { | ||
} | ||
return !win()[key]; | ||
}; | ||
/** | ||
* @param {object} def | ||
* @param {any} def | ||
* @returns {window} | ||
*/ | ||
exports.hasWin = hasWin; | ||
var win = function win(def) { | ||
@@ -61,3 +53,2 @@ if (def === void 0) { | ||
} | ||
return ( | ||
@@ -71,3 +62,2 @@ /** | ||
}; | ||
exports.win = win; |
{ | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"name": "win-doc", | ||
@@ -4,0 +4,0 @@ "repository": { |
/** | ||
* @param {object|undefined} w | ||
* @param {object} def | ||
* @param {any} def | ||
* @returns {document} | ||
*/ | ||
export function doc(w?: object | undefined, def?: object): Document; | ||
export function doc(w?: object | undefined, def?: any): Document; | ||
/** | ||
* @param {object} def | ||
* @param {any} def | ||
* @returns {window} | ||
*/ | ||
export function win(def?: object): Window & typeof globalThis; | ||
export function win(def?: any): Window & typeof globalThis; | ||
/** | ||
@@ -13,0 +13,0 @@ * @param {string} key |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5279