@hylid/env 3.3.0-alpha.9 → 4.0.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.
Files changed (2) hide show
  1. package/lib/utils.js +2 -8
  2. package/package.json +1 -1
package/lib/utils.js CHANGED
@@ -36,20 +36,14 @@ export function getSettingName() {
36
36
  var _a;
37
37
  var clientMatch = ((_a = window.location.search) === null || _a === void 0 ? void 0 : _a.match(/__app__=([^&]*)/)) || [];
38
38
  var client = clientMatch[1];
39
- var platform = (window.location.search.match(/[?&]__platform__=([^?&=]+)/) || [])[1];
39
+ var platformMatch = window.location.search.match(/__platform__=([^&]*)/) || [];
40
+ var platform = platformMatch[1];
40
41
  if (client || platform) {
41
42
  localStorage.setItem('__hy_env__', JSON.stringify({
42
43
  client: client,
43
44
  platform: platform
44
45
  }));
45
46
  }
46
- // 将 url 上的 __app__ 删除,避免影响分享的链接
47
- if (clientMatch[1]) {
48
- var search = window.location.search.replace(new RegExp("".concat(clientMatch[0], "(&)*")), '');
49
- var hash = window.location.hash || '';
50
- var newUrl = "".concat(window.location.pathname).concat(search).concat(hash);
51
- history.replaceState(null, '', newUrl);
52
- }
53
47
  var cached = localStorage.getItem('__hy_env__');
54
48
  return cached ? JSON.parse(cached) : {};
55
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hylid/env",
3
- "version": "3.3.0-alpha.9",
3
+ "version": "4.0.0-alpha.2",
4
4
  "main": "lib/index.js",
5
5
  "files": [
6
6
  "lib"