@ray-js/env 1.4.0-alpha.1 → 1.4.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/platform.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- declare type Platform = 'thing' | 'web' | 'wechat' | 'ios' | 'android';
1
+ type Platform = 'thing' | 'web' | 'wechat' | 'ios' | 'android';
2
2
  export declare const isWeb: boolean;
3
+ export declare const env: Platform;
3
4
  export declare const isWechat: boolean;
4
5
  export declare const isThing: boolean;
5
6
  export declare const isMiniProgram: boolean;
6
7
  export declare const isNative = false;
7
8
  export declare const isAndroid = false;
8
9
  export declare const isIOS = false;
9
- export declare const env: Platform;
10
10
  export {};
package/cjs/platform.js CHANGED
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.env = exports.isIOS = exports.isAndroid = exports.isNative = exports.isMiniProgram = exports.isThing = exports.isWechat = exports.isWeb = void 0;
3
+ exports.isIOS = exports.isAndroid = exports.isNative = exports.isMiniProgram = exports.isThing = exports.isWechat = exports.env = exports.isWeb = void 0;
4
4
  exports.isWeb = typeof window !== 'undefined' && 'onload' in window;
5
- exports.isWechat = typeof wx !== 'undefined' &&
6
- wx !== null &&
7
- (typeof wx.request !== 'undefined' || typeof wx.miniProgram !== 'undefined');
8
- exports.isThing = typeof ty !== 'undefined' && ty !== null;
5
+ // @ts-ignore
6
+ exports.env = process.env.PLATFORM;
7
+ exports.isWechat = exports.env === 'wechat';
8
+ exports.isThing = exports.env === 'thing';
9
9
  exports.isMiniProgram = exports.isWechat || exports.isThing;
10
10
  exports.isNative = false;
11
11
  exports.isAndroid = false;
12
12
  exports.isIOS = false;
13
- exports.env = process.env.PLATFORM;
package/esm/platform.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- declare type Platform = 'thing' | 'web' | 'wechat' | 'ios' | 'android';
1
+ type Platform = 'thing' | 'web' | 'wechat' | 'ios' | 'android';
2
2
  export declare const isWeb: boolean;
3
+ export declare const env: Platform;
3
4
  export declare const isWechat: boolean;
4
5
  export declare const isThing: boolean;
5
6
  export declare const isMiniProgram: boolean;
6
7
  export declare const isNative = false;
7
8
  export declare const isAndroid = false;
8
9
  export declare const isIOS = false;
9
- export declare const env: Platform;
10
10
  export {};
package/esm/platform.js CHANGED
@@ -1,10 +1,9 @@
1
1
  export const isWeb = typeof window !== 'undefined' && 'onload' in window;
2
- export const isWechat = typeof wx !== 'undefined' &&
3
- wx !== null &&
4
- (typeof wx.request !== 'undefined' || typeof wx.miniProgram !== 'undefined');
5
- export const isThing = typeof ty !== 'undefined' && ty !== null;
2
+ // @ts-ignore
3
+ export const env = process.env.PLATFORM;
4
+ export const isWechat = env === 'wechat';
5
+ export const isThing = env === 'thing';
6
6
  export const isMiniProgram = isWechat || isThing;
7
7
  export const isNative = false;
8
8
  export const isAndroid = false;
9
9
  export const isIOS = false;
10
- export const env = process.env.PLATFORM;
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
1
  {
2
2
  "name": "@ray-js/env",
3
- "version": "1.4.0-alpha.1",
3
+ "version": "1.4.0-alpha.11",
4
4
  "description": "Ray runtime environment",
5
5
  "keywords": [
6
6
  "ray"
7
7
  ],
8
+ "repository": {},
8
9
  "license": "MIT",
10
+ "maintainers": [
11
+ {
12
+ "name": "tuyafe",
13
+ "email": "tuyafe@tuya.com"
14
+ }
15
+ ],
9
16
  "main": "cjs/index.js",
10
17
  "module": "esm/index.js",
11
18
  "files": [
12
19
  "cjs",
13
20
  "esm"
14
21
  ],
15
- "publishConfig": {
16
- "access": "public",
17
- "registry": "https://registry.npmjs.org"
18
- },
19
22
  "scripts": {
20
- "clean": "rm -rf cjs esm",
21
23
  "build": "yarn build:cjs && yarn build:esm",
22
24
  "build:cjs": "tsc -p ./tsconfig.build.json --target es5 --module commonjs --outDir cjs",
23
25
  "build:esm": "tsc -p ./tsconfig.build.json --target es6 --module esnext --outDir esm",
26
+ "clean": "rm -rf cjs esm",
24
27
  "watch": "concurrently 'yarn build:cjs --watch' 'yarn build:esm --watch'"
25
28
  },
26
- "maintainers": [
27
- {
28
- "name": "tuyafe",
29
- "email": "tuyafe@tuya.com"
30
- }
31
- ],
32
29
  "devDependencies": {
33
- "concurrently": "^7.0.0"
30
+ "concurrently": "^7.6.0"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public",
34
+ "registry": "https://registry.npmjs.org"
34
35
  },
35
- "gitHead": "4340240aafe16c03853241e2356134610e65443e",
36
- "repository": {}
36
+ "gitHead": "5e9c8e1d288eeaf707d34515399784d98ec13a1e"
37
37
  }