Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uni/env

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uni/env - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

dist/index.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.uni_env=e():t.uni_env=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";n.r(e),function(t,r){function o(t){return"undefined"===t}n.d(e,"isWeb",(function(){return i})),n.d(e,"isNode",(function(){return u})),n.d(e,"isWeex",(function(){return c})),n.d(e,"isKraken",(function(){return f})),n.d(e,"isMiniApp",(function(){return s})),n.d(e,"isByteDanceMicroApp",(function(){return a})),n.d(e,"isBaiduSmartProgram",(function(){return l})),n.d(e,"isKuaiShouMiniProgram",(function(){return p})),n.d(e,"isWeChatMiniProgram",(function(){return d})),n.d(e,"isQuickApp",(function(){return y}));var i=!o(typeof window)&&"onload"in window,u=!o(typeof t)&&!(!t.versions||!t.versions.node),c=!o(typeof WXEnvironment)&&"Web"!==WXEnvironment.platform,f=!o(typeof __kraken__),s=!o(typeof my)&&null!==my&&!o(typeof my.alert),a=!o(typeof tt)&&null!==tt&&!o(typeof tt)&&!o(tt.showToast),l=!o(typeof swan)&&null!==swan&&!o(typeof swan)&&!o(swan.showToast),p=!o(typeof ks)&&null!==ks&&!o(typeof ks)&&!o(ks.showToast),d=!(a||o(typeof wx)||null===wx||o(typeof wx.login)&&o(typeof wx.miniProgram)),y=!o(typeof r)&&null!==r&&!o(typeof r.callNative)&&!c;e.default={isWeb:i,isNode:u,isWeex:c,isKraken:f,isMiniApp:s,isByteDanceMicroApp:a,isBaiduSmartProgram:l,isKuaiShouMiniProgram:p,isWeChatMiniProgram:d,isQuickApp:y}}.call(this,n(2),n(3))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var f,s=[],a=!1,l=-1;function p(){a&&f&&(a=!1,f.length?s=f.concat(s):l=-1,s.length&&d())}function d(){if(!a){var t=c(p);a=!0;for(var e=s.length;e;){for(f=s,s=[];++l<e;)f&&f[l].run();l=-1,e=s.length}f=null,a=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new y(t,e)),1!==s.length||a||c(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(){return[]},o.binding=function(){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){var n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])}));
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.uni_env=e():n.uni_env=e()}(window,(function(){return function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(r,o,function(e){return n[e]}.bind(null,o));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){n.exports=t(1)},function(n,e,t){"use strict";t.r(e),function(n,r){t.d(e,"isWeb",(function(){return o})),t.d(e,"isNode",(function(){return i})),t.d(e,"isWeex",(function(){return u})),t.d(e,"isKraken",(function(){return c})),t.d(e,"isMiniApp",(function(){return f})),t.d(e,"isByteDanceMicroApp",(function(){return s})),t.d(e,"isBaiduSmartProgram",(function(){return a})),t.d(e,"isKuaiShouMiniProgram",(function(){return d})),t.d(e,"isWeChatMiniProgram",(function(){return l})),t.d(e,"isQuickApp",(function(){return p}));var o="undefined"!=typeof window&&"onload"in window,i=void 0!==n&&!(!n.versions||!n.versions.node),u="undefined"!=typeof WXEnvironment&&"Web"!==WXEnvironment.platform,c="undefined"!=typeof __kraken__,f="undefined"!=typeof my&&null!==my&&void 0!==my.alert,s="undefined"!=typeof tt&&null!==tt&&void 0!==tt.showToast,a="undefined"!=typeof swan&&null!==swan&&void 0!==swan.showToast,d="undefined"!=typeof ks&&null!==ks&&void 0!==ks.showToast,l=!s&&"undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram),p=null!=r&&void 0!==r.callNative&&!u;e.default={isWeb:o,isNode:i,isWeex:u,isKraken:c,isMiniApp:f,isByteDanceMicroApp:s,isBaiduSmartProgram:a,isKuaiShouMiniProgram:d,isWeChatMiniProgram:l,isQuickApp:p}}.call(this,t(2),t(3))},function(n,e){var t,r,o=n.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(n){if(t===setTimeout)return setTimeout(n,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(n,0);try{return t(n,0)}catch(e){try{return t.call(null,n,0)}catch(e){return t.call(this,n,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(n){t=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(n){r=u}}();var f,s=[],a=!1,d=-1;function l(){a&&f&&(a=!1,f.length?s=f.concat(s):d=-1,s.length&&p())}function p(){if(!a){var n=c(l);a=!0;for(var e=s.length;e;){for(f=s,s=[];++d<e;)f&&f[d].run();d=-1,e=s.length}f=null,a=!1,function(n){if(r===clearTimeout)return clearTimeout(n);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(n);try{r(n)}catch(e){try{return r.call(null,n)}catch(e){return r.call(this,n)}}}(n)}}function m(n,e){this.fun=n,this.array=e}function y(){}o.nextTick=function(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];s.push(new m(n,e)),1!==s.length||a||c(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(){return[]},o.binding=function(){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(n,e){var t=function(){return this}();try{t=t||new Function("return this")()}catch(n){"object"==typeof window&&(t=window)}n.exports=t}])}));

@@ -1,18 +0,14 @@

function isUndef(type) {
return type === 'undefined';
}
export var isWeb = !isUndef(typeof window) && 'onload' in window;
export var isNode = !isUndef(typeof process) && !!(process.versions && process.versions.node);
export var isWeex = !isUndef(typeof WXEnvironment) && WXEnvironment.platform !== 'Web';
export var isKraken = !isUndef(typeof __kraken__);
export var isMiniApp = !isUndef(typeof my) && my !== null && !isUndef(typeof my.alert);
export var isByteDanceMicroApp = !isUndef(typeof tt) && tt !== null && !isUndef(typeof tt) && !isUndef(tt.showToast);
export var isBaiduSmartProgram = !isUndef(typeof swan) && swan !== null && !isUndef(typeof swan) && !isUndef(swan.showToast);
export var isKuaiShouMiniProgram = !isUndef(typeof ks) && ks !== null && !isUndef(typeof ks) && !isUndef(ks.showToast); // In wechat mini program, wx.login is a function
export var isWeb = typeof window !== 'undefined' && 'onload' in window;
export var isNode = typeof process !== 'undefined' && !!(process.versions && process.versions.node);
export var isWeex = typeof WXEnvironment !== 'undefined' && WXEnvironment.platform !== 'Web';
export var isKraken = typeof __kraken__ !== 'undefined';
export var isMiniApp = typeof my !== 'undefined' && my !== null && typeof my.alert !== 'undefined';
export var isByteDanceMicroApp = typeof tt !== 'undefined' && tt !== null && typeof tt.showToast !== 'undefined';
export var isBaiduSmartProgram = typeof swan !== 'undefined' && swan !== null && typeof swan.showToast !== 'undefined';
export var isKuaiShouMiniProgram = typeof ks !== 'undefined' && ks !== null && typeof ks.showToast !== 'undefined'; // In wechat mini program, wx.login is a function
// In wechat mini propgram webview, there is no wx.login, but exist wx.miniProgram
// In bytedance maicro app, there is wx variable.
export var isWeChatMiniProgram = !isByteDanceMicroApp && !isUndef(typeof wx) && wx !== null && (!isUndef(typeof wx.login) || !isUndef(typeof wx.miniProgram));
export var isQuickApp = !isUndef(typeof global) && global !== null && !isUndef(typeof global.callNative) && !isWeex;
export var isWeChatMiniProgram = !isByteDanceMicroApp && typeof wx !== 'undefined' && wx !== null && (typeof wx.request !== 'undefined' || typeof wx.miniProgram !== 'undefined');
export var isQuickApp = typeof global !== 'undefined' && global !== null && typeof global.callNative !== 'undefined' && !isWeex;
export default {

@@ -19,0 +15,0 @@ isWeb: isWeb,

@@ -5,22 +5,17 @@ "use strict";

exports.default = exports.isQuickApp = exports.isWeChatMiniProgram = exports.isKuaiShouMiniProgram = exports.isBaiduSmartProgram = exports.isByteDanceMicroApp = exports.isMiniApp = exports.isKraken = exports.isWeex = exports.isNode = exports.isWeb = void 0;
function isUndef(type) {
return type === 'undefined';
}
var isWeb = !isUndef(typeof window) && 'onload' in window;
var isWeb = typeof window !== 'undefined' && 'onload' in window;
exports.isWeb = isWeb;
var isNode = !isUndef(typeof process) && !!(process.versions && process.versions.node);
var isNode = typeof process !== 'undefined' && !!(process.versions && process.versions.node);
exports.isNode = isNode;
var isWeex = !isUndef(typeof WXEnvironment) && WXEnvironment.platform !== 'Web';
var isWeex = typeof WXEnvironment !== 'undefined' && WXEnvironment.platform !== 'Web';
exports.isWeex = isWeex;
var isKraken = !isUndef(typeof __kraken__);
var isKraken = typeof __kraken__ !== 'undefined';
exports.isKraken = isKraken;
var isMiniApp = !isUndef(typeof my) && my !== null && !isUndef(typeof my.alert);
var isMiniApp = typeof my !== 'undefined' && my !== null && typeof my.alert !== 'undefined';
exports.isMiniApp = isMiniApp;
var isByteDanceMicroApp = !isUndef(typeof tt) && tt !== null && !isUndef(typeof tt) && !isUndef(tt.showToast);
var isByteDanceMicroApp = typeof tt !== 'undefined' && tt !== null && typeof tt.showToast !== 'undefined';
exports.isByteDanceMicroApp = isByteDanceMicroApp;
var isBaiduSmartProgram = !isUndef(typeof swan) && swan !== null && !isUndef(typeof swan) && !isUndef(swan.showToast);
var isBaiduSmartProgram = typeof swan !== 'undefined' && swan !== null && typeof swan.showToast !== 'undefined';
exports.isBaiduSmartProgram = isBaiduSmartProgram;
var isKuaiShouMiniProgram = !isUndef(typeof ks) && ks !== null && !isUndef(typeof ks) && !isUndef(ks.showToast); // In wechat mini program, wx.login is a function
var isKuaiShouMiniProgram = typeof ks !== 'undefined' && ks !== null && typeof ks.showToast !== 'undefined'; // In wechat mini program, wx.login is a function
// In wechat mini propgram webview, there is no wx.login, but exist wx.miniProgram

@@ -30,5 +25,5 @@ // In bytedance maicro app, there is wx variable.

exports.isKuaiShouMiniProgram = isKuaiShouMiniProgram;
var isWeChatMiniProgram = !isByteDanceMicroApp && !isUndef(typeof wx) && wx !== null && (!isUndef(typeof wx.login) || !isUndef(typeof wx.miniProgram));
var isWeChatMiniProgram = !isByteDanceMicroApp && typeof wx !== 'undefined' && wx !== null && (typeof wx.request !== 'undefined' || typeof wx.miniProgram !== 'undefined');
exports.isWeChatMiniProgram = isWeChatMiniProgram;
var isQuickApp = !isUndef(typeof global) && global !== null && !isUndef(typeof global.callNative) && !isWeex;
var isQuickApp = typeof global !== 'undefined' && global !== null && typeof global.callNative !== 'undefined' && !isWeex;
exports.isQuickApp = isQuickApp;

@@ -35,0 +30,0 @@ var _default = {

@@ -1,1 +0,1 @@

{"name":"@uni/env","version":"1.0.6","description":"","main":"lib/index.js","module":"es/index.js","unpkg":"dist/index.js","typings":"types/index.d.ts","sideEffects":false,"exports":{".":{"web":"./es/web/index.js","wechat-miniprogram":"./es/wechat-miniprogram/index.js","bytedance-microapp":"./es/bytedance-microapp/index.js","miniapp":"./es/ali-miniapp/index.js","require":"./lib/index.js","default":"./es/index.js"},"./*":"./*"},"repository":{"type":"git","url":"git@github.com:raxjs/universal-api.git"},"license":"BSD-3-Clause","author":"rax"}
{"name":"@uni/env","version":"1.0.7","description":"","main":"lib/index.js","module":"es/index.js","unpkg":"dist/index.js","typings":"types/index.d.ts","sideEffects":false,"repository":{"type":"git","url":"git@github.com:raxjs/universal-api.git"},"license":"BSD-3-Clause","author":"rax"}

@@ -1,6 +0,6 @@

interface Ob {
export interface Ob {
[key: string]: any;
}
interface Ext {
export interface Ext {
wechatMiniProgram?: Ob;

@@ -14,3 +14,3 @@ aliMiniApp?: Ob;

declare namespace Uni {
export declare namespace Uni {
interface COptions {

@@ -17,0 +17,0 @@ _ext?: Ext;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc