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

@hylid/env

Package Overview
Dependencies
Maintainers
0
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hylid/env - npm Package Compare versions

Comparing version 3.0.0-alpha.4 to 3.0.0-alpha.7

7

lib/index.d.ts
import { ClientEnv, PlatformEnv } from './types';
declare let client: string | undefined;
declare let platform: string | undefined;
export declare function getDefaultDiscernEnv(): {
client: string | undefined;
platform: string | undefined;
};
declare let client: string | undefined, platform: string | undefined;
interface CustomEnv {

@@ -5,0 +8,0 @@ client?: string;

import { createCommonEnv, getSettingName, isMP, notice } from "./utils";
import { getName4MP, getName4MpWeb, getName4Web } from "./getClientName";
import { CLIENT, PLATFORM } from "./constants";
var client;
var platform;
if (isMP()) {
client = getName4MP();
platform = PLATFORM.MP;
} else {
var setting = getSettingName();
if (setting.platform) {
platform = setting.platform;
client = setting.client || (platform === 'mpweb' ? getName4MpWeb() : getName4Web());
export function getDefaultDiscernEnv() {
var client;
var platform;
if (isMP()) {
client = getName4MP();
platform = PLATFORM.MP;
} else {
// 如果只设置了 client,默认是套壳场景
client = setting.client || getName4MpWeb();
if (client) {
platform = PLATFORM.MPWEB;
var setting = getSettingName();
if (setting.platform) {
platform = setting.platform;
client = setting.client || (platform === 'mpweb' ? getName4MpWeb() : getName4Web());
} else {
client = getName4Web();
platform = PLATFORM.WEB;
// 如果只设置了 client,默认是套壳场景
client = setting.client || getName4MpWeb();
if (client) {
platform = PLATFORM.MPWEB;
} else {
client = getName4Web();
platform = PLATFORM.WEB;
}
}
}
if (!platform || !client) {
notice('Cannot identify your client.');
}
return {
client: client,
platform: platform
};
}
if (!platform || !client) {
notice('Cannot identify your client.');
}
var _a = getDefaultDiscernEnv(),
client = _a.client,
platform = _a.platform;
export function customEnv(config) {

@@ -29,0 +38,0 @@ var custom = typeof config === 'function' ? config({

{
"name": "@hylid/env",
"version": "3.0.0-alpha.4",
"version": "3.0.0-alpha.7",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "files": [

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