@hylid/env 0.0.90011267721-dev.2 → 0.0.90011267721-dev.3

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.
@@ -1,6 +1,6 @@
1
1
  import { mpWebChecker } from "../checker";
2
- import { getMatchName } from "../utils";
2
+ import { getMatchName, isClient } from "../utils";
3
3
  export function getName4MpWeb() {
4
- var _a;
5
- return getMatchName(mpWebChecker, ((_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) || '');
4
+ if (!isClient) return '';
5
+ return getMatchName(mpWebChecker, window.navigator.userAgent);
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { webChecker } from "../checker";
2
2
  import { CLIENT } from "../constants";
3
- import { getMatchName } from "../utils";
3
+ import { getMatchName, isClient } from "../utils";
4
4
  export function getName4Web() {
5
- var _a;
6
- return getMatchName(webChecker, ((_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) || '') || CLIENT.H5;
5
+ if (!isClient) return CLIENT.H5;
6
+ return getMatchName(webChecker, window.navigator.userAgent) || CLIENT.H5;
7
7
  }
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '0.0.90011267721-dev.2';
1
+ export default '0.0.90011267721-dev.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hylid/env",
3
- "version": "0.0.90011267721-dev.2",
3
+ "version": "0.0.90011267721-dev.3",
4
4
  "main": "lib/index.js",
5
5
  "files": [
6
6
  "lib"