universal-env
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -47,5 +47,2 @@ | ||
/* 0 */ | ||
/*!*********************************************!*\ | ||
!*** ./packages/universal-env/src/index.js ***! | ||
\*********************************************/ | ||
/***/ function(module, exports) { | ||
@@ -61,3 +58,4 @@ | ||
var isWeb = exports.isWeb = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && _typeof(window.document) === 'object' && (typeof navigator === 'undefined' ? 'undefined' : _typeof(navigator)) === 'object' && typeof navigator.userAgent === 'string'; | ||
// https://www.w3.org/TR/html5/webappapis.html#dom-navigator-appcodename | ||
var isWeb = exports.isWeb = (typeof navigator === 'undefined' ? 'undefined' : _typeof(navigator)) === 'object' && (navigator.appCodeName === 'Mozilla' || navigator.product === 'Gecko'); | ||
var isNode = exports.isNode = typeof process !== 'undefined' && !!(process.versions && process.versions.node); | ||
@@ -64,0 +62,0 @@ var isWeex = exports.isWeex = typeof callNative === 'function'; |
;(function(fn) { | ||
if (typeof exports === "object" && typeof module !== "undefined") { | ||
module.exports = fn(); | ||
} else if (typeof define === "function") { | ||
if (typeof define === "function") { | ||
define("universal-env", function(require, exports, module){ | ||
module.exports = fn(); | ||
}); | ||
} else if (typeof exports === "object" && typeof module !== "undefined") { | ||
module.exports = fn(); | ||
} else { | ||
@@ -13,6 +13,6 @@ var root; | ||
root = window; | ||
} else if (typeof self !== "undefined") { | ||
root = self; | ||
} else if (typeof global !== "undefined") { | ||
root = global; | ||
} else if (typeof self !== "undefined") { | ||
root = self; | ||
} else { | ||
@@ -22,3 +22,3 @@ // NOTICE: In JavaScript strict mode, this is null | ||
} | ||
root.Env = fn(); | ||
root["Env"] = fn(); | ||
} | ||
@@ -70,5 +70,2 @@ })(function(){ | ||
/* 0 */ | ||
/*!*********************************************!*\ | ||
!*** ./packages/universal-env/src/index.js ***! | ||
\*********************************************/ | ||
/***/ function(module, exports) { | ||
@@ -84,3 +81,4 @@ | ||
var isWeb = exports.isWeb = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && _typeof(window.document) === 'object' && (typeof navigator === 'undefined' ? 'undefined' : _typeof(navigator)) === 'object' && typeof navigator.userAgent === 'string'; | ||
// https://www.w3.org/TR/html5/webappapis.html#dom-navigator-appcodename | ||
var isWeb = exports.isWeb = (typeof navigator === 'undefined' ? 'undefined' : _typeof(navigator)) === 'object' && (navigator.appCodeName === 'Mozilla' || navigator.product === 'Gecko'); | ||
var isNode = exports.isNode = typeof process !== 'undefined' && !!(process.versions && process.versions.node); | ||
@@ -87,0 +85,0 @@ var isWeex = exports.isWeex = typeof callNative === 'function'; |
@@ -1,5 +0,2 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("universal-env",function(o,n,t){t.exports=e()});else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.Env=e()}}(function(){return function(e){function o(t){if(n[t])return n[t].exports;var i=n[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}var n={};return o.m=e,o.c=n,o.p="",o(0)}([/*!*********************************************!*\ | ||
!*** ./packages/universal-env/src/index.js ***! | ||
\*********************************************/ | ||
function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o.isWeb="object"===("undefined"==typeof window?"undefined":n(window))&&"object"===n(window.document)&&"object"===("undefined"==typeof navigator?"undefined":n(navigator))&&"string"==typeof navigator.userAgent,o.isNode="undefined"!=typeof process&&!(!process.versions||!process.versions.node),o.isWeex="function"==typeof callNative,o.isReactNative="undefined"!=typeof __fbBatchedBridgeConfig}])}); | ||
!function(e){if("function"==typeof define)define("universal-env",function(o,n,t){t.exports=e()});else if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this,o.Env=e()}}(function(){return function(e){function o(t){if(n[t])return n[t].exports;var i=n[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}var n={};return o.m=e,o.c=n,o.p="",o(0)}([function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o.isWeb="object"===("undefined"==typeof navigator?"undefined":n(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product),o.isNode="undefined"!=typeof process&&!(!process.versions||!process.versions.node),o.isWeex="function"==typeof callNative,o.isReactNative="undefined"!=typeof __fbBatchedBridgeConfig}])}); | ||
//# sourceMappingURL=env.min.map |
@@ -9,5 +9,6 @@ 'use strict'; | ||
var isWeb = exports.isWeb = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && _typeof(window.document) === 'object' && (typeof navigator === 'undefined' ? 'undefined' : _typeof(navigator)) === 'object' && typeof navigator.userAgent === 'string'; | ||
// https://www.w3.org/TR/html5/webappapis.html#dom-navigator-appcodename | ||
var isWeb = exports.isWeb = (typeof navigator === 'undefined' ? 'undefined' : _typeof(navigator)) === 'object' && (navigator.appCodeName === 'Mozilla' || navigator.product === 'Gecko'); | ||
var isNode = exports.isNode = typeof process !== 'undefined' && !!(process.versions && process.versions.node); | ||
var isWeex = exports.isWeex = typeof callNative === 'function'; | ||
var isReactNative = exports.isReactNative = typeof __fbBatchedBridgeConfig !== 'undefined'; |
{ | ||
"name": "universal-env", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A universal environment utilities.", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
@@ -1,4 +0,5 @@ | ||
export const isWeb = typeof window === 'object' && typeof window.document === 'object' && typeof navigator === 'object' && typeof navigator.userAgent === 'string'; | ||
// https://www.w3.org/TR/html5/webappapis.html#dom-navigator-appcodename | ||
export const isWeb = typeof navigator === 'object' && (navigator.appCodeName === 'Mozilla' || navigator.product === 'Gecko'); | ||
export const isNode = typeof process !== 'undefined' && !!(process.versions && process.versions.node); | ||
export const isWeex = typeof callNative === 'function'; | ||
export const isReactNative = typeof __fbBatchedBridgeConfig !== 'undefined'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
20175
157