@noah-libjs/utils 0.0.6 → 0.0.7

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/es.js CHANGED
@@ -1500,7 +1500,11 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
1500
1500
  // }
1501
1501
  function get_global() {
1502
1502
  var _a;
1503
- return (_a = window !== null && window !== void 0 ? window : globalThis) !== null && _a !== void 0 ? _a : global;
1503
+ try {
1504
+ return (_a = globalThis !== null && globalThis !== void 0 ? globalThis : window) !== null && _a !== void 0 ? _a : global;
1505
+ } catch (error) {
1506
+ return {};
1507
+ }
1504
1508
  }
1505
1509
  function getSearchParamsValue(key) {
1506
1510
  var _a, _b;
package/dist/lib.js CHANGED
@@ -1510,7 +1510,11 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
1510
1510
  // }
1511
1511
  function get_global() {
1512
1512
  var _a;
1513
- return (_a = window !== null && window !== void 0 ? window : globalThis) !== null && _a !== void 0 ? _a : global;
1513
+ try {
1514
+ return (_a = globalThis !== null && globalThis !== void 0 ? globalThis : window) !== null && _a !== void 0 ? _a : global;
1515
+ } catch (error) {
1516
+ return {};
1517
+ }
1514
1518
  }
1515
1519
  function getSearchParamsValue(key) {
1516
1520
  var _a, _b;
@@ -1,6 +1,6 @@
1
1
  import { AnyObject } from "./type-utils";
2
2
  export type TCommonFileType = 'application/vnd.ms-excel' | 'text/csv;charset=utf-8' | 'application/msword';
3
- export declare function get_global(): Window & typeof globalThis;
3
+ export declare function get_global(): typeof globalThis;
4
4
  export declare function getSearchParamsValue(key: string): string | null;
5
5
  export declare function getSearchParamsAll(url?: URL): AnyObject<string>;
6
6
  export declare function setSearchParamsValue(key: string, value: string | number): URL;
package/dist/typing.d.ts CHANGED
@@ -716,7 +716,7 @@ type AnyObject<T = any> = {
716
716
  };
717
717
 
718
718
  type TCommonFileType = 'application/vnd.ms-excel' | 'text/csv;charset=utf-8' | 'application/msword';
719
- declare function get_global(): Window & typeof globalThis;
719
+ declare function get_global(): typeof globalThis;
720
720
  declare function getSearchParamsValue(key: string): string | null;
721
721
  declare function getSearchParamsAll(url?: URL): AnyObject<string>;
722
722
  declare function setSearchParamsValue(key: string, value: string | number): URL;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noah-libjs/utils",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -34,5 +34,5 @@
34
34
  "keywords": [],
35
35
  "author": "",
36
36
  "license": "MIT",
37
- "gitHead": "c9728dacb73b81f38c4c9ff2d3e122a904afe9d0"
37
+ "gitHead": "fcd560c4526837addb257776124afb9381853236"
38
38
  }