@alwatr/global-this 5.5.11 โ†’ 5.5.13

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.5.13](https://github.com/Alwatr/nanolib/compare/@alwatr/global-this@5.5.12...@alwatr/global-this@5.5.13) (2025-09-14)
7
+
8
+ ### ๐Ÿ› Bug Fixes
9
+
10
+ * refactor globalThis initialization for improved clarity and error handling ([df79e21](https://github.com/Alwatr/nanolib/commit/df79e217c485adfaf806567893d78c2fada289a6))
11
+
12
+ ## [5.5.12](https://github.com/Alwatr/nanolib/compare/@alwatr/global-this@5.5.11...@alwatr/global-this@5.5.12) (2025-09-13)
13
+
14
+ ### ๐Ÿ”— Dependencies update
15
+
16
+ * update @types/node version to ^22.18.3 in multiple package.json files ([13db6fc](https://github.com/Alwatr/nanolib/commit/13db6fc176bc6cdcefedc50d77ac550bd5052c9a))
17
+
6
18
  ## [5.5.11](https://github.com/Alwatr/nanolib/compare/@alwatr/global-this@5.5.10...@alwatr/global-this@5.5.11) (2025-09-13)
7
19
 
8
20
  ### ๐Ÿงน Miscellaneous Chores
package/dist/main.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /* @alwatr/global-this v5.5.11 */
1
+ /* @alwatr/global-this v5.5.13 */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -24,7 +24,13 @@ __export(main_exports, {
24
24
  getGlobalThis: () => getGlobalThis
25
25
  });
26
26
  module.exports = __toCommonJS(main_exports);
27
- var globalThis__ = typeof globalThis === "object" && globalThis || typeof window === "object" && window || typeof global === "object" && global || self;
27
+ var globalThis__ = /* @__PURE__ */ (() => {
28
+ if (typeof globalThis === "object" && globalThis) return globalThis;
29
+ if (typeof window === "object" && window) return window;
30
+ if (typeof global === "object" && global) return global;
31
+ if (typeof self === "object" && self) return self;
32
+ throw new Error("alwatr/logger: Could not find global object.");
33
+ })();
28
34
  function getGlobalThis() {
29
35
  return globalThis__;
30
36
  }
package/dist/main.cjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
- "sourcesContent": ["export type GlobalThis = typeof globalThis;\n\nconst globalThis__: GlobalThis =\n (typeof globalThis === 'object' && globalThis) ||\n (typeof window === 'object' && window) ||\n (typeof global === 'object' && global) ||\n self;\n\n/**\n * Provides access to `globalThis`, ensuring cross-platform compatibility.\n *\n * @example\n * ```typescript\n * getGlobalThis<{alwatr:{foo: string}}>().alwatr = {\n * foo: 'bar',\n * }\n * ```\n */\nexport function getGlobalThis<T extends DictionaryOpt = GlobalThis>(): GlobalThis & T {\n return globalThis__ as GlobalThis & T;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAM,eACH,OAAO,eAAe,YAAY,cAClC,OAAO,WAAW,YAAY,UAC9B,OAAO,WAAW,YAAY,UAC/B;AAYK,SAAS,gBAAsE;AACpF,SAAO;AACT;",
4
+ "sourcesContent": ["export type GlobalThis = typeof globalThis;\n\nconst globalThis__: GlobalThis = /* #__PURE__ */ (() => {\n if (typeof globalThis === 'object' && globalThis) return globalThis;\n if (typeof window === 'object' && window) return window;\n if (typeof global === 'object' && global) return global;\n if (typeof self === 'object' && self) return self;\n throw new Error('alwatr/logger: Could not find global object.');\n})();\n\n/**\n * Provides access to `globalThis`, ensuring cross-platform compatibility.\n *\n * @example\n * ```typescript\n * getGlobalThis<{alwatr:{foo: string}}>().alwatr = {\n * foo: 'bar',\n * }\n * ```\n */\nexport function getGlobalThis<T extends DictionaryOpt = GlobalThis>(): GlobalThis & T {\n return globalThis__ as GlobalThis & T;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAM,eAA4C,uBAAM;AACtD,MAAI,OAAO,eAAe,YAAY,WAAY,QAAO;AACzD,MAAI,OAAO,WAAW,YAAY,OAAQ,QAAO;AACjD,MAAI,OAAO,WAAW,YAAY,OAAQ,QAAO;AACjD,MAAI,OAAO,SAAS,YAAY,KAAM,QAAO;AAC7C,QAAM,IAAI,MAAM,8CAA8C;AAChE,GAAG;AAYI,SAAS,gBAAsE;AACpF,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAQ3C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,GAAG,UAAU,KAAK,UAAU,GAAG,CAAC,CAEpF"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAU3C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,GAAG,UAAU,KAAK,UAAU,GAAG,CAAC,CAEpF"}
package/dist/main.mjs CHANGED
@@ -1,7 +1,13 @@
1
- /* @alwatr/global-this v5.5.11 */
1
+ /* @alwatr/global-this v5.5.13 */
2
2
 
3
3
  // src/main.ts
4
- var globalThis__ = typeof globalThis === "object" && globalThis || typeof window === "object" && window || typeof global === "object" && global || self;
4
+ var globalThis__ = /* @__PURE__ */ (() => {
5
+ if (typeof globalThis === "object" && globalThis) return globalThis;
6
+ if (typeof window === "object" && window) return window;
7
+ if (typeof global === "object" && global) return global;
8
+ if (typeof self === "object" && self) return self;
9
+ throw new Error("alwatr/logger: Could not find global object.");
10
+ })();
5
11
  function getGlobalThis() {
6
12
  return globalThis__;
7
13
  }
package/dist/main.mjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
- "sourcesContent": ["export type GlobalThis = typeof globalThis;\n\nconst globalThis__: GlobalThis =\n (typeof globalThis === 'object' && globalThis) ||\n (typeof window === 'object' && window) ||\n (typeof global === 'object' && global) ||\n self;\n\n/**\n * Provides access to `globalThis`, ensuring cross-platform compatibility.\n *\n * @example\n * ```typescript\n * getGlobalThis<{alwatr:{foo: string}}>().alwatr = {\n * foo: 'bar',\n * }\n * ```\n */\nexport function getGlobalThis<T extends DictionaryOpt = GlobalThis>(): GlobalThis & T {\n return globalThis__ as GlobalThis & T;\n}\n"],
5
- "mappings": ";;;AAEA,IAAM,eACH,OAAO,eAAe,YAAY,cAClC,OAAO,WAAW,YAAY,UAC9B,OAAO,WAAW,YAAY,UAC/B;AAYK,SAAS,gBAAsE;AACpF,SAAO;AACT;",
4
+ "sourcesContent": ["export type GlobalThis = typeof globalThis;\n\nconst globalThis__: GlobalThis = /* #__PURE__ */ (() => {\n if (typeof globalThis === 'object' && globalThis) return globalThis;\n if (typeof window === 'object' && window) return window;\n if (typeof global === 'object' && global) return global;\n if (typeof self === 'object' && self) return self;\n throw new Error('alwatr/logger: Could not find global object.');\n})();\n\n/**\n * Provides access to `globalThis`, ensuring cross-platform compatibility.\n *\n * @example\n * ```typescript\n * getGlobalThis<{alwatr:{foo: string}}>().alwatr = {\n * foo: 'bar',\n * }\n * ```\n */\nexport function getGlobalThis<T extends DictionaryOpt = GlobalThis>(): GlobalThis & T {\n return globalThis__ as GlobalThis & T;\n}\n"],
5
+ "mappings": ";;;AAEA,IAAM,eAA4C,uBAAM;AACtD,MAAI,OAAO,eAAe,YAAY,WAAY,QAAO;AACzD,MAAI,OAAO,WAAW,YAAY,OAAQ,QAAO;AACjD,MAAI,OAAO,WAAW,YAAY,OAAQ,QAAO;AACjD,MAAI,OAAO,SAAS,YAAY,KAAM,QAAO;AAC7C,QAAM,IAAI,MAAM,8CAA8C;AAChE,GAAG;AAYI,SAAS,gBAAsE;AACpF,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@alwatr/global-this",
3
3
  "description": "Provides access to `globalThis`, ensuring cross-platform compatibility, including browsers (`window`), Node.js (`global`), and Web Workers (`self`).",
4
- "version": "5.5.11",
4
+ "version": "5.5.13",
5
5
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "bugs": "https://github.com/Alwatr/nanolib/issues",
7
7
  "devDependencies": {
8
- "@alwatr/nano-build": "6.1.1",
8
+ "@alwatr/nano-build": "6.1.2",
9
9
  "@alwatr/prettier-config": "5.0.3",
10
10
  "@alwatr/tsconfig-base": "6.0.1",
11
- "@alwatr/type-helper": "6.0.1",
12
- "@types/node": "^22.18.1",
11
+ "@alwatr/type-helper": "6.0.2",
12
+ "@types/node": "^22.18.3",
13
13
  "typescript": "^5.9.2"
14
14
  },
15
15
  "exports": {
@@ -75,5 +75,5 @@
75
75
  },
76
76
  "type": "module",
77
77
  "types": "./dist/main.d.ts",
78
- "gitHead": "0555c6f5ac11e7a911deee9bc90cfa44b6fe0b48"
78
+ "gitHead": "4249b4e06eeb5739e1d6dbacfbce5b33a3180263"
79
79
  }