Comparing version 0.1.0 to 0.1.1
@@ -18,6 +18,5 @@ "use strict"; | ||
var doc = function doc(w) { | ||
var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultObj; | ||
var doc = function doc(w, def) { | ||
w = w || win(); | ||
return _reshowConstant.UNDEFINED !== (0, _typeof2["default"])(w.document) ? w.document : def; | ||
return _reshowConstant.UNDEFINED !== (0, _typeof2["default"])(w.document) ? w.document : def || defaultObj; | ||
}; | ||
@@ -33,4 +32,3 @@ | ||
var win = function win() { | ||
var def = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultObj; | ||
var win = function win(def) { | ||
return ( | ||
@@ -41,3 +39,3 @@ /** | ||
*/ | ||
"undefined" !== typeof window ? window : def | ||
"undefined" !== typeof window ? window : def || defaultObj | ||
); | ||
@@ -44,0 +42,0 @@ }; |
@@ -7,6 +7,5 @@ import _typeof from "reshow-runtime/es/helpers/typeof"; | ||
var doc = function doc(w) { | ||
var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultObj; | ||
var doc = function doc(w, def) { | ||
w = w || win(); | ||
return UNDEFINED !== _typeof(w.document) ? w.document : def; | ||
return UNDEFINED !== _typeof(w.document) ? w.document : def || defaultObj; | ||
}; | ||
@@ -18,4 +17,3 @@ | ||
var win = function win() { | ||
var def = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultObj; | ||
var win = function win(def) { | ||
return ( | ||
@@ -26,3 +24,3 @@ /** | ||
*/ | ||
"undefined" !== typeof window ? window : def | ||
"undefined" !== typeof window ? window : def || defaultObj | ||
); | ||
@@ -29,0 +27,0 @@ }; |
{ | ||
"name": "win-doc", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Simple to avoid global not found error", | ||
@@ -5,0 +5,0 @@ "repository": "react-atomic/react-atomic-organism", |
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
5659
157