@alwatr/global-this 6.0.0 → 6.0.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.
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/package.json +36 -37
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 📦 @alwatr/global-this v6.0.
|
|
2
|
-
var j=(()=>{if(typeof globalThis==="object"&&globalThis)return globalThis;if(typeof window==="object"&&window)return window;if(typeof global==="object"&&global)return global;if(typeof self==="object"&&self)return self;throw Error("@alwatr/global-this v6.0.
|
|
1
|
+
/* 📦 @alwatr/global-this v6.0.2 */
|
|
2
|
+
var j=(()=>{if(typeof globalThis==="object"&&globalThis)return globalThis;if(typeof window==="object"&&window)return window;if(typeof global==="object"&&global)return global;if(typeof self==="object"&&self)return self;throw Error("@alwatr/global-this v6.0.2: Could not find global object.")})();function k(){return j}export{k as getGlobalThis};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=1096FB8B977ECE6764756E2164756E21
|
|
5
5
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type {} from '@alwatr/nano-build';\nimport type {} from '@alwatr/type-helper';\n\nexport type GlobalThis = typeof globalThis;\n\n/**\n * The global object in various JavaScript environments.\n * It checks for `globalThis`, `window`, `global`, and `self` in that order.\n * @private\n */\nconst globalThis__: GlobalThis = (() => {\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(`${__package_name__} v${__package_version__}: 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"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAUA,IAAM,GAA4B,IAAM,CACtC,GAAI,OAAO,aAAe,UAAY,WAAY,OAAO,WACzD,GAAI,OAAO,SAAW,UAAY,OAAQ,OAAO,OACjD,GAAI,OAAO,SAAW,UAAY,OAAQ,OAAO,OACjD,GAAI,OAAO,OAAS,UAAY,KAAM,OAAO,KAC7C,MAAU,MAAM,2DAA4E,IAC3F,EAYI,SAAS,CAAmD,EAAmB,CACpF,OAAO",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "1096FB8B977ECE6764756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/global-this",
|
|
3
|
+
"version": "6.0.2",
|
|
3
4
|
"description": "Provides access to `globalThis`, ensuring cross-platform compatibility, including browsers (`window`), Node.js (`global`), and Web Workers (`self`).",
|
|
4
|
-
"
|
|
5
|
+
"license": "MPL-2.0",
|
|
5
6
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"@alwatr/type-helper": "8.0.0",
|
|
12
|
-
"@types/node": "^24.12.0",
|
|
13
|
-
"typescript": "^5.9.3"
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"directory": "packages/global-this",
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Alwatr/nanolib"
|
|
14
12
|
},
|
|
13
|
+
"homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/global-this#readme",
|
|
14
|
+
"bugs": "https://github.com/Alwatr/nanolib/issues",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"types": "./dist/main.d.ts",
|
|
18
18
|
"default": "./dist/main.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@alwatr/nano-build": "7.0.1",
|
|
24
|
+
"@alwatr/prettier-config": "7.0.1",
|
|
25
|
+
"@alwatr/tsconfig-base": "8.0.0",
|
|
26
|
+
"@alwatr/type-helper": "8.0.2",
|
|
27
|
+
"@types/node": "^24.12.0",
|
|
28
|
+
"typescript": "^6.0.2"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"b": "bun run build",
|
|
32
|
+
"build": "bun run build:ts && bun run build:es",
|
|
33
|
+
"build:es": "nano-build --preset=module src/main.ts",
|
|
34
|
+
"build:ts": "tsc --build",
|
|
35
|
+
"c": "bun run clean",
|
|
36
|
+
"cb": "bun run clean && bun run build",
|
|
37
|
+
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
38
|
+
"d": "bun run build:es && bun",
|
|
39
|
+
"w": "bun run watch",
|
|
40
|
+
"watch": "bun run watch:ts & bun run watch:es",
|
|
41
|
+
"watch:es": "bun run build:es --watch",
|
|
42
|
+
"watch:ts": "bun run build:ts --watch --preserveWatchOutput"
|
|
43
|
+
},
|
|
21
44
|
"files": [
|
|
22
45
|
"**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
|
|
23
46
|
"README.md",
|
|
@@ -25,7 +48,9 @@
|
|
|
25
48
|
"!demo/**/*",
|
|
26
49
|
"!**/*.test.js"
|
|
27
50
|
],
|
|
28
|
-
"
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
29
54
|
"keywords": [
|
|
30
55
|
"alwatr",
|
|
31
56
|
"browser",
|
|
@@ -48,32 +73,6 @@
|
|
|
48
73
|
"utility",
|
|
49
74
|
"utils"
|
|
50
75
|
],
|
|
51
|
-
"license": "MPL-2.0",
|
|
52
76
|
"prettier": "@alwatr/prettier-config",
|
|
53
|
-
"
|
|
54
|
-
"access": "public"
|
|
55
|
-
},
|
|
56
|
-
"repository": {
|
|
57
|
-
"type": "git",
|
|
58
|
-
"url": "https://github.com/Alwatr/nanolib",
|
|
59
|
-
"directory": "packages/global-this"
|
|
60
|
-
},
|
|
61
|
-
"scripts": {
|
|
62
|
-
"b": "bun run build",
|
|
63
|
-
"build": "bun run build:ts && bun run build:es",
|
|
64
|
-
"build:es": "nano-build --preset=module src/main.ts",
|
|
65
|
-
"build:ts": "tsc --build",
|
|
66
|
-
"c": "bun run clean",
|
|
67
|
-
"cb": "bun run clean && bun run build",
|
|
68
|
-
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
69
|
-
"d": "bun run build:es && bun",
|
|
70
|
-
"w": "bun run watch",
|
|
71
|
-
"watch": "bun run watch:ts & bun run watch:es",
|
|
72
|
-
"watch:es": "bun run build:es --watch",
|
|
73
|
-
"watch:ts": "bun run build:ts --watch --preserveWatchOutput"
|
|
74
|
-
},
|
|
75
|
-
"sideEffects": false,
|
|
76
|
-
"type": "module",
|
|
77
|
-
"types": "./dist/main.d.ts",
|
|
78
|
-
"gitHead": "056102a1c8a563bbae8a290b6830450f467322a3"
|
|
77
|
+
"gitHead": "95bb13efd0a5f485c6b09f1a911b99492017aed1"
|
|
79
78
|
}
|