@hylid/env 4.0.3 → 4.0.4

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/lib/checker/mp.js CHANGED
@@ -2,12 +2,9 @@ import { CLIENT } from "../constants";
2
2
  export var mpChecker = [{
3
3
  name: CLIENT.DEMO,
4
4
  match: [/demo/]
5
- }, {
6
- name: CLIENT.ALIPAY,
7
- match: [/alipay/]
8
5
  }, {
9
6
  name: CLIENT.ALIPAYHK,
10
- match: [/hk/]
7
+ match: [/alipayHK/]
11
8
  }, {
12
9
  name: CLIENT.TNGD,
13
10
  match: [/tngd/]
@@ -23,4 +20,8 @@ export var mpChecker = [{
23
20
  }, {
24
21
  name: CLIENT.TOSSPAY,
25
22
  match: [/toss/]
23
+ }, {
24
+ // 为了避免 alipayHK 被识别成 alipay, 需要把以下条件放到末尾
25
+ name: CLIENT.ALIPAY,
26
+ match: [/alipay/]
26
27
  }];
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ClientEnv, PlatformEnv } from './types';
2
+ import version from './version';
2
3
  export declare function getDefaultDiscernEnv(): {
3
4
  client: string | undefined;
4
5
  platform: string | undefined;
@@ -12,5 +13,5 @@ export declare function customEnv(config: CustomEnv | ((env: CustomEnv) => Custo
12
13
  declare const clientEnv: ClientEnv;
13
14
  declare const platformEnv: PlatformEnv;
14
15
  export { CLIENT, PLATFORM } from './constants';
15
- export { client, platform, clientEnv, platformEnv };
16
+ export { client, platform, clientEnv, platformEnv, version };
16
17
  export type { ClientEnv, PlatformEnv, CustomEnv };
package/lib/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { createCommonEnv, getSettingName, isMP, notice } from "./utils";
2
2
  import { getName4MP, getName4MpWeb, getName4Web } from "./getClientName";
3
3
  import { CLIENT, PLATFORM } from "./constants";
4
+ import version from "./version";
4
5
  export function getDefaultDiscernEnv() {
5
6
  var client;
6
7
  var platform;
@@ -53,4 +54,4 @@ export function customEnv(config) {
53
54
  var clientEnv = createCommonEnv(CLIENT, client);
54
55
  var platformEnv = createCommonEnv(PLATFORM, platform);
55
56
  export { CLIENT, PLATFORM } from "./constants";
56
- export { client, platform, clientEnv, platformEnv };
57
+ export { client, platform, clientEnv, platformEnv, version };
@@ -0,0 +1,2 @@
1
+ declare const _default: "$version$";
2
+ export default _default;
package/lib/version.js ADDED
@@ -0,0 +1 @@
1
+ export default '4.0.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hylid/env",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "main": "lib/index.js",
5
5
  "files": [
6
6
  "lib"