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

universal-env

Package Overview
Dependencies
Maintainers
5
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

universal-env - npm Package Compare versions

Comparing version 3.2.0-0 to 3.2.0-1

2

lib/index.d.ts

@@ -6,4 +6,4 @@ export declare const isWeb: boolean;

export declare const isMiniApp: boolean;
export declare const isByteDanceMicroApp: boolean;
export declare const isWeChatMiniProgram: boolean;
export declare const isQuickApp: boolean;
export declare const isByteDanceMicroApp: boolean;
"use strict";
exports.__esModule = true;
exports.isByteDanceMicroApp = exports.isQuickApp = exports.isWeChatMiniProgram = exports.isMiniApp = exports.isKraken = exports.isWeex = exports.isNode = exports.isWeb = void 0;
exports.isQuickApp = exports.isWeChatMiniProgram = exports.isByteDanceMicroApp = exports.isMiniApp = exports.isKraken = exports.isWeex = exports.isNode = exports.isWeb = void 0;

@@ -18,11 +18,12 @@ function isUndef(type) {

exports.isKraken = isKraken;
var isMiniApp = !isUndef(typeof my) && my !== null && !isUndef(typeof my.alert); // In wechat mini program, wx.login is a function
var isMiniApp = !isUndef(typeof my) && my !== null && !isUndef(typeof my.alert);
exports.isMiniApp = isMiniApp;
var isByteDanceMicroApp = !isUndef(typeof tt) && tt !== null && !isUndef(typeof tt) && !isUndef(tt.showToast); // 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.
exports.isMiniApp = isMiniApp;
var isWeChatMiniProgram = !isUndef(typeof wx) && wx !== null && (!isUndef(typeof wx.login) || !isUndef(typeof wx.miniProgram));
exports.isByteDanceMicroApp = isByteDanceMicroApp;
var isWeChatMiniProgram = !isByteDanceMicroApp && !isUndef(typeof wx) && wx !== null && (!isUndef(typeof wx.login) || !isUndef(typeof wx.miniProgram));
exports.isWeChatMiniProgram = isWeChatMiniProgram;
var isQuickApp = !isUndef(typeof global) && global !== null && !isUndef(typeof global.callNative) && !isWeex;
exports.isQuickApp = isQuickApp;
var isByteDanceMicroApp = !isUndef(typeof tt) && tt !== null && !isUndef(typeof tt) && !isUndef(tt.showToast);
exports.isByteDanceMicroApp = isByteDanceMicroApp;
exports.isQuickApp = isQuickApp;
{
"name": "universal-env",
"author": "rax",
"version": "3.2.0-0",
"version": "3.2.0-1",
"description": "",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

@@ -17,6 +17,7 @@ declare const WXEnvironment: any;

export const isMiniApp = !isUndef(typeof my) && my !== null && !isUndef(typeof my.alert);
export const isByteDanceMicroApp = !isUndef(typeof tt) && tt !== null && !isUndef(typeof tt) && !isUndef(tt.showToast);
// In wechat mini program, wx.login is a function
// In wechat mini propgram webview, there is no wx.login, but exist wx.miniProgram
export const isWeChatMiniProgram = !isUndef(typeof wx) && wx !== null && (!isUndef(typeof wx.login) || !isUndef(typeof wx.miniProgram));
// In bytedance maicro app, there is wx variable.
export const isWeChatMiniProgram = !isByteDanceMicroApp && !isUndef(typeof wx) && wx !== null && (!isUndef(typeof wx.login) || !isUndef(typeof wx.miniProgram));
export const isQuickApp = !isUndef(typeof global) && global !== null && !isUndef(typeof global.callNative) && !isWeex;
export const isByteDanceMicroApp = !isUndef(typeof tt) && tt !== null && !isUndef(typeof tt) && !isUndef(tt.showToast);
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