@uni-helper/uni-env 0.1.7 → 0.1.8

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/dist/index.cjs CHANGED
@@ -20,8 +20,8 @@ const platform = process.env.UNI_PLATFORM;
20
20
  const appPlatform = stdEnv.env.UNI_APP_PLATFORM;
21
21
  const subPlatform = process.env.UNI_SUB_PLATFORM;
22
22
  const utsPlatform = stdEnv.env.UNI_UTS_PLATFORM;
23
- const isH5 = platform === "h5";
24
- const isWeb = platform === "web";
23
+ const isH5 = platform === "h5" || platform === "web";
24
+ const isWeb = platform === "web" || platform === "h5";
25
25
  const isApp = platform === "app";
26
26
  const isAppPlus = platform === "app-plus";
27
27
  const isAppHarmony = platform === "app-harmony";
package/dist/index.d.cts CHANGED
@@ -57,9 +57,9 @@ type UtsPlatform = BuiltInPlatform | 'app-android' | 'app-ios' | 'web';
57
57
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L12}
58
58
  */
59
59
  declare const utsPlatform: UtsPlatform;
60
- /** Detect if `process.env.UNI_PLATFORM` is `h5` */
60
+ /** Detect if `process.env.UNI_PLATFORM` is `h5` or if `process.env.UNI_PLATFORM` is `web` */
61
61
  declare const isH5: boolean;
62
- /** Detect if `process.env.UNI_PLATFORM` is `web` */
62
+ /** Detect if `process.env.UNI_PLATFORM` is `web` or if `process.env.UNI_PLATFORM` is `h5` */
63
63
  declare const isWeb: boolean;
64
64
  /** Detect if `process.env.UNI_PLATFORM` is `app` */
65
65
  declare const isApp: boolean;
package/dist/index.d.mts CHANGED
@@ -57,9 +57,9 @@ type UtsPlatform = BuiltInPlatform | 'app-android' | 'app-ios' | 'web';
57
57
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L12}
58
58
  */
59
59
  declare const utsPlatform: UtsPlatform;
60
- /** Detect if `process.env.UNI_PLATFORM` is `h5` */
60
+ /** Detect if `process.env.UNI_PLATFORM` is `h5` or if `process.env.UNI_PLATFORM` is `web` */
61
61
  declare const isH5: boolean;
62
- /** Detect if `process.env.UNI_PLATFORM` is `web` */
62
+ /** Detect if `process.env.UNI_PLATFORM` is `web` or if `process.env.UNI_PLATFORM` is `h5` */
63
63
  declare const isWeb: boolean;
64
64
  /** Detect if `process.env.UNI_PLATFORM` is `app` */
65
65
  declare const isApp: boolean;
package/dist/index.d.ts CHANGED
@@ -57,9 +57,9 @@ type UtsPlatform = BuiltInPlatform | 'app-android' | 'app-ios' | 'web';
57
57
  * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4020920240930001/packages/shims-node.d.ts#L12}
58
58
  */
59
59
  declare const utsPlatform: UtsPlatform;
60
- /** Detect if `process.env.UNI_PLATFORM` is `h5` */
60
+ /** Detect if `process.env.UNI_PLATFORM` is `h5` or if `process.env.UNI_PLATFORM` is `web` */
61
61
  declare const isH5: boolean;
62
- /** Detect if `process.env.UNI_PLATFORM` is `web` */
62
+ /** Detect if `process.env.UNI_PLATFORM` is `web` or if `process.env.UNI_PLATFORM` is `h5` */
63
63
  declare const isWeb: boolean;
64
64
  /** Detect if `process.env.UNI_PLATFORM` is `app` */
65
65
  declare const isApp: boolean;
package/dist/index.mjs CHANGED
@@ -18,8 +18,8 @@ const platform = process.env.UNI_PLATFORM;
18
18
  const appPlatform = env.UNI_APP_PLATFORM;
19
19
  const subPlatform = process.env.UNI_SUB_PLATFORM;
20
20
  const utsPlatform = env.UNI_UTS_PLATFORM;
21
- const isH5 = platform === "h5";
22
- const isWeb = platform === "web";
21
+ const isH5 = platform === "h5" || platform === "web";
22
+ const isWeb = platform === "web" || platform === "h5";
23
23
  const isApp = platform === "app";
24
24
  const isAppPlus = platform === "app-plus";
25
25
  const isAppHarmony = platform === "app-harmony";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uni-helper/uni-env",
3
3
  "type": "module",
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "description": "在 uni-app 中优雅地判断当前环境。",
6
6
  "author": "KeJun",
7
7
  "maintainers": [