@ray-js/env 1.4.0-alpha.1 → 1.4.0-alpha.2
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 +1 -1
- package/cjs/platform.js +5 -6
- package/esm/platform.d.ts +1 -1
- package/esm/platform.js +4 -5
- package/package.json +2 -2
package/cjs/platform.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare 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.
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.isThing =
|
|
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
1
|
declare 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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const isThing =
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/env",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.2",
|
|
4
4
|
"description": "Ray runtime environment",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ray"
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"concurrently": "^7.0.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "15732640dc24f1ef6c461db601afc0fcbd3eb9ff",
|
|
36
36
|
"repository": {}
|
|
37
37
|
}
|