globables 2.0.1 → 3.2.0
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/README.md +10 -0
- package/dist/index.cjs +26 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.cts +31 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/index.min.cjs +0 -1
- package/dist/index.min.js +0 -1
package/README.md
CHANGED
|
@@ -17,16 +17,26 @@ import {
|
|
|
17
17
|
ARGV,
|
|
18
18
|
ENV,
|
|
19
19
|
GLOBAL_THIS,
|
|
20
|
+
// is* runtime helpers
|
|
21
|
+
IS_BUN,
|
|
22
|
+
IS_DENO,
|
|
23
|
+
IS_NODE,
|
|
24
|
+
IS_QUICKJS,
|
|
25
|
+
// is_* service helpers
|
|
26
|
+
IS_CLOUDFLARE_WORKER,
|
|
27
|
+
IS_VERCEL_EDGE,
|
|
20
28
|
} from 'globables';
|
|
21
29
|
|
|
22
30
|
GLOBAL_THIS.console.log(`Shellin with ${ENV['SHELL']} and commandin ${ARGV.join(', ')}`);
|
|
23
31
|
```
|
|
24
32
|
> ╸`ARGV` - [command-line arguments](https://nodejs.org/api/process.html#processargv) (includes an export alias of `ARGS`)<br/>
|
|
25
33
|
> ╸`ENV` - [process environment](https://nodejs.org/api/process.html#processenv) <br/>
|
|
34
|
+
> ━╸ **QuickJS**: only works with `qjs --std -m` not `qjs --std -c`<br />
|
|
26
35
|
> ╸`GLOBAL_THIS` - [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) object; pollyfill'ed if missing, like prehistoric node <12<br/>
|
|
27
36
|
> ╸ All Runtimes/Globals Tested -> [./src/index.test.ts](https://github.com/fetchTe/globables/blob/master/src/index.test.ts)<br/>
|
|
28
37
|
|
|
29
38
|
|
|
39
|
+
|
|
30
40
|
<br/>
|
|
31
41
|
|
|
32
42
|
|
package/dist/index.cjs
CHANGED
|
@@ -22,7 +22,13 @@ __export(index_exports, {
|
|
|
22
22
|
ARGS: () => ARGS,
|
|
23
23
|
ARGV: () => ARGV,
|
|
24
24
|
ENV: () => ENV,
|
|
25
|
-
GLOBAL_THIS: () => GLOBAL_THIS
|
|
25
|
+
GLOBAL_THIS: () => GLOBAL_THIS,
|
|
26
|
+
IS_BUN: () => IS_BUN,
|
|
27
|
+
IS_CLOUDFLARE_WORKER: () => IS_CLOUDFLARE_WORKER,
|
|
28
|
+
IS_DENO: () => IS_DENO,
|
|
29
|
+
IS_NODE: () => IS_NODE,
|
|
30
|
+
IS_QUICKJS: () => IS_QUICKJS,
|
|
31
|
+
IS_VERCEL_EDGE: () => IS_VERCEL_EDGE
|
|
26
32
|
});
|
|
27
33
|
module.exports = __toCommonJS(index_exports);
|
|
28
34
|
var GLOBAL_THIS = /* @__PURE__ */ (() => typeof globalThis === "object" ? globalThis : (() => {
|
|
@@ -51,11 +57,29 @@ var ENV = /* @__PURE__ */ (() => {
|
|
|
51
57
|
return {};
|
|
52
58
|
})();
|
|
53
59
|
})();
|
|
60
|
+
var IS_BUN = /* @__PURE__ */ (() => !!(GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["Bun"]))();
|
|
61
|
+
var IS_DENO = /* @__PURE__ */ (() => !!(GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["Deno"]))();
|
|
62
|
+
var IS_QUICKJS = /* @__PURE__ */ (() => typeof scriptArgs !== "undefined")();
|
|
63
|
+
var IS_NODE = /* @__PURE__ */ (() => {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
return (
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
|
+
!IS_BUN && !IS_DENO && !!((_b = (_a = GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["process"]) == null ? void 0 : _a.versions) == null ? void 0 : _b.node)
|
|
68
|
+
);
|
|
69
|
+
})();
|
|
70
|
+
var IS_CLOUDFLARE_WORKER = /* @__PURE__ */ (() => typeof (GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["WebSocketPair"]) === "function" && typeof (GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["navigator"]) === "undefined")();
|
|
71
|
+
var IS_VERCEL_EDGE = /* @__PURE__ */ (() => !!(GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["EdgeRuntime"]))();
|
|
54
72
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
73
|
0 && (module.exports = {
|
|
56
74
|
ARGS,
|
|
57
75
|
ARGV,
|
|
58
76
|
ENV,
|
|
59
|
-
GLOBAL_THIS
|
|
77
|
+
GLOBAL_THIS,
|
|
78
|
+
IS_BUN,
|
|
79
|
+
IS_CLOUDFLARE_WORKER,
|
|
80
|
+
IS_DENO,
|
|
81
|
+
IS_NODE,
|
|
82
|
+
IS_QUICKJS,
|
|
83
|
+
IS_VERCEL_EDGE
|
|
60
84
|
});
|
|
61
85
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export type GlobalThis = typeof globalThis;\nexport type ProcessArgv = NodeJS.Process['argv'];\nexport type ProcessEnv = NodeJS.ProcessEnv;\n\n\n/**\n * globalThis object - with pollyfil in case of prehistoric node <12\n * @see {@link https://tc39.es/ecma262/multipage/global-object.html#sec-globalthis|globalThis spec - ECMAScript }\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis|globalThis docs - MDN}\n */\nexport const GLOBAL_THIS = /* @__PURE__ */ (() =>\n typeof globalThis === 'object'\n ? globalThis\n /**\n * globalThis pollyfill\n * @see {@link https://mathiasbynens.be/notes/globalthis}\n * @see {@link https://github.com/ungap/global-this}\n */\n : (() => {\n // @ts-expect-error - globalThis pollyfill for prehistoric node envs\n // eslint-disable-next-line\n !(function (Object) {function get() {const e = this || self; e.globalThis = e, delete Object.prototype._T_;}'object' != typeof globalThis && (this ? get() : (Object.defineProperty(Object.prototype, '_T_', {configurable:!0, get:get}), _T_));}(Object));\n // just in case\n return typeof globalThis === 'object' ? globalThis : {};\n })()\n)() as GlobalThis;\n\n\n/**\n * command-line arguments (pure/iffe wrapped so we can shake the tree)\n * @see {@link https://nodejs.org/api/process.html#processargv|process.argv - Node.js}\n * @see {@link https://bellard.org/quickjs/quickjs.html#Global-objects|scriptArgs - QuickJS}\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib#scriptargs|scriptArgs - QuickJS-NG}\n * @see {@link https://docs.deno.com/api/node/process/~/Process#property_argv|process.argv - Deno}\n * @see {@link https://docs.deno.com/api/deno/~/Deno.CommandOptions#property_args|Deno.args - Deno}\n */\nexport const ARGV: NodeJS.Process['argv'] = /* @__PURE__ */ (() =>\n typeof process === 'undefined'\n /** quickJs {@link https://bellard.org/quickjs/quickjs.html#Global-objects} */\n ? typeof scriptArgs !== 'undefined'\n ? scriptArgs\n : []\n : ((GLOBAL_THIS as never)?.['Deno']\n // @NOTE: DENO.args does not require any perm requests\n // @NOTE: if --allow-all is used, no args (like --allow-env), use default\n // @ts-expect-error deno uses 'args' rather than 'argv'\n ? (GLOBAL_THIS as never)?.['Deno']?.args\n // @ts-expect-error deno uses 'args' rather than 'argv'\n ?? (process['args']?.length ? process['args'] : process['argv'])\n : process['argv']\n ) ?? []\n)();\nexport const ARGS = ARGV;\n\n/**\n * process environment (ENV) variables\n * @see {@link https://nodejs.org/api/process.html#processenv|process.env - Node.js}\n * @see {@link https://docs.deno.com/runtime/reference/env_variables/#built-in-deno.env|env - Deno}\n * @see {@link https://bellard.org/quickjs/quickjs.html#Global-objects|getenviron - QuickJS}\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib#getenviron|getenviron - QuickJS-NG}\n */\nexport const ENV = /* @__PURE__ */ (() => typeof process === 'undefined'\n // @ts-expect-error quickjs std\n ? typeof (GLOBAL_THIS as never)?.['std']?.getenviron === 'function'\n // @ts-expect-error quickjs std\n ? ((GLOBAL_THIS as never)['std'].getenviron?.() ?? {})\n : {}\n : (!(GLOBAL_THIS as never)?.['Deno']\n ? process['env']\n : (() => {\n try {\n // @NOTE: if --allow-all is used, no toObject (like --allow-env), use default\n // @NOTE: DENO.env.toObject only requires one perm request while process requires many\n // @ts-expect-error deno perms\n // eslint-disable-next-line @stylistic/max-len\n return (GLOBAL_THIS as never)?.['Deno']?.env?.toObject?.() ?? (process['env']?.toObject ? process['env']?.toObject() : process['env']);\n } catch (_err) { /* ignore */ }\n return {};\n })())\n)() as ProcessEnv;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,cAA+B,uBAC1C,OAAO,eAAe,WAClB,cAMC,MAAM;AAGP,IAAE,SAAUA,SAAQ;AAAC,aAAS,MAAM;AAAC,YAAM,IAAI,QAAQ;AAAM,QAAE,aAAa,GAAG,OAAOA,QAAO,UAAU;AAAA,IAAI;AAAC,gBAAY,OAAO,eAAe,OAAO,IAAI,KAAKA,QAAO,eAAeA,QAAO,WAAW,OAAO,EAAC,cAAa,MAAI,IAAO,CAAC,GAAG;AAAA,EAAM,GAAE,MAAM;AAExP,SAAO,OAAO,eAAe,WAAW,aAAa,CAAC;AACxD,GAAG,GACL;AAWK,IAAM,OAAgD,uBAAG;AApChE;AAqCE,gBAAO,YAAY,cAEf,OAAO,eAAe,cACpB,aACA,CAAC,KACD,iDAAwB,YAIvB,sDAAwB,YAAxB,mBAAiC,SAAjC,cAEG,aAAQ,MAAM,MAAd,mBAAiB,UAAS,QAAQ,MAAM,IAAI,QAAQ,MAAM,IAC9D,QAAQ,MAAM,MAPd,YAQC,CAAC;AAAA,GACR;AACK,IAAM,OAAO;AASb,IAAM,MAAuB,uBAAG;AA7DvC;AA6D0C,gBAAO,YAAY,cAEzD,SAAQ,gDAAwB,WAAxB,mBAAgC,gBAAe,
|
|
4
|
+
"sourcesContent": ["export type GlobalThis = typeof globalThis;\nexport type ProcessArgv = NodeJS.Process['argv'];\nexport type ProcessEnv = NodeJS.ProcessEnv;\n\n\n/**\n * globalThis object - with pollyfil in case of prehistoric node <12\n * @see {@link https://tc39.es/ecma262/multipage/global-object.html#sec-globalthis|globalThis spec - ECMAScript }\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis|globalThis docs - MDN}\n */\nexport const GLOBAL_THIS = /* @__PURE__ */ (() =>\n typeof globalThis === 'object'\n ? globalThis\n /**\n * globalThis pollyfill\n * @see {@link https://mathiasbynens.be/notes/globalthis}\n * @see {@link https://github.com/ungap/global-this}\n */\n : (() => {\n // @ts-expect-error - globalThis pollyfill for prehistoric node envs\n // eslint-disable-next-line\n !(function (Object) {function get() {const e = this || self; e.globalThis = e, delete Object.prototype._T_;}'object' != typeof globalThis && (this ? get() : (Object.defineProperty(Object.prototype, '_T_', {configurable:!0, get:get}), _T_));}(Object));\n // just in case\n return typeof globalThis === 'object' ? globalThis : {};\n })()\n)() as GlobalThis;\n\n\n/**\n * command-line arguments (pure/iffe wrapped so we can shake the tree)\n * @see {@link https://nodejs.org/api/process.html#processargv|process.argv - Node.js}\n * @see {@link https://bellard.org/quickjs/quickjs.html#Global-objects|scriptArgs - QuickJS}\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib#scriptargs|scriptArgs - QuickJS-NG}\n * @see {@link https://docs.deno.com/api/node/process/~/Process#property_argv|process.argv - Deno}\n * @see {@link https://docs.deno.com/api/deno/~/Deno.CommandOptions#property_args|Deno.args - Deno}\n */\nexport const ARGV: NodeJS.Process['argv'] = /* @__PURE__ */ (() =>\n typeof process === 'undefined'\n /** quickJs {@link https://bellard.org/quickjs/quickjs.html#Global-objects} */\n ? typeof scriptArgs !== 'undefined'\n ? scriptArgs\n : []\n : ((GLOBAL_THIS as never)?.['Deno']\n // @NOTE: DENO.args does not require any perm requests\n // @NOTE: if --allow-all is used, no args (like --allow-env), use default\n // @ts-expect-error deno uses 'args' rather than 'argv'\n ? (GLOBAL_THIS as never)?.['Deno']?.args\n // @ts-expect-error deno uses 'args' rather than 'argv'\n ?? (process['args']?.length ? process['args'] : process['argv'])\n : process['argv']\n ) ?? []\n)();\nexport const ARGS = ARGV;\n\n/**\n * process environment (ENV) variables\n * @see {@link https://nodejs.org/api/process.html#processenv|process.env - Node.js}\n * @see {@link https://docs.deno.com/runtime/reference/env_variables/#built-in-deno.env|env - Deno}\n * @see {@link https://bellard.org/quickjs/quickjs.html#Global-objects|getenviron - QuickJS}\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib#getenviron|getenviron - QuickJS-NG}\n */\nexport const ENV = /* @__PURE__ */ (() => typeof process === 'undefined'\n // @ts-expect-error quickjs std\n ? typeof (GLOBAL_THIS as never)?.['std']?.getenviron === 'function'\n // @ts-expect-error quickjs std -> only works via 'qjs --std --module <file>'\n // if 'qjs --std --compile <file>'; 'getenviron' is only accessible via: import * as std from 'qjs:std'\n ? ((GLOBAL_THIS as never)['std'].getenviron?.() ?? {})\n : {}\n : (!(GLOBAL_THIS as never)?.['Deno']\n ? process['env']\n : (() => {\n try {\n // @NOTE: if --allow-all is used, no toObject (like --allow-env), use default\n // @NOTE: DENO.env.toObject only requires one perm request while process requires many\n // @ts-expect-error deno perms\n // eslint-disable-next-line @stylistic/max-len\n return (GLOBAL_THIS as never)?.['Deno']?.env?.toObject?.() ?? (process['env']?.toObject ? process['env']?.toObject() : process['env']);\n } catch (_err) { /* ignore */ }\n return {};\n })())\n)() as ProcessEnv;\n\n\n/**\n * detects if running in the Bun runtime\n * @see {@link https://bun.sh/docs/api/globals|Bun globals}\n */\nexport const IS_BUN: boolean = /* @__PURE__ */ (() =>\n !!(GLOBAL_THIS as never)?.['Bun']\n)();\n\n\n/**\n * detects if running in the Deno runtime\n * @see {@link https://docs.deno.com/api/deno/~/Deno|Deno}\n */\nexport const IS_DENO: boolean = /* @__PURE__ */ (() =>\n !!(GLOBAL_THIS as never)?.['Deno']\n)();\n\n\n/**\n * detects if running in the QuickJs runtime\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib/#globals}\n */\nexport const IS_QUICKJS: boolean = /* @__PURE__ */ (() =>\n typeof scriptArgs !== 'undefined'\n)();\n\n\n/**\n * detects if running in Node.js\n * @see {@link https://nodejs.org/api/process.html#processversions|process.versions docs}\n */\nexport const IS_NODE: boolean = /* @__PURE__ */ (() =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n !IS_BUN && !IS_DENO && !!(GLOBAL_THIS as any)?.['process']?.versions?.node\n)();\n\n\n/**\n * detects if running inside Cloudflare Workers\n * - Workers expose 'WebSocketPair' and lack 'navigator'\n * @see {@link https://developers.cloudflare.com/workers/runtime-apis/websockets}\n */\nexport const IS_CLOUDFLARE_WORKER: boolean = /* @__PURE__ */ (() =>\n typeof (GLOBAL_THIS as never)?.['WebSocketPair'] === 'function'\n && typeof (GLOBAL_THIS as never)?.['navigator'] === 'undefined'\n)();\n\n\n/**\n * detects if running inside Vercel Edge\n * @see {@link https://vercel.com/docs/functions/runtimes/edge#check-if-you're-running-on-the-edge-runtime}\n */\nexport const IS_VERCEL_EDGE: boolean = /* @__PURE__ */ (() =>\n !!(GLOBAL_THIS as never)?.['EdgeRuntime']\n)();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,cAA+B,uBAC1C,OAAO,eAAe,WAClB,cAMC,MAAM;AAGP,IAAE,SAAUA,SAAQ;AAAC,aAAS,MAAM;AAAC,YAAM,IAAI,QAAQ;AAAM,QAAE,aAAa,GAAG,OAAOA,QAAO,UAAU;AAAA,IAAI;AAAC,gBAAY,OAAO,eAAe,OAAO,IAAI,KAAKA,QAAO,eAAeA,QAAO,WAAW,OAAO,EAAC,cAAa,MAAI,IAAO,CAAC,GAAG;AAAA,EAAM,GAAE,MAAM;AAExP,SAAO,OAAO,eAAe,WAAW,aAAa,CAAC;AACxD,GAAG,GACL;AAWK,IAAM,OAAgD,uBAAG;AApChE;AAqCE,gBAAO,YAAY,cAEf,OAAO,eAAe,cACpB,aACA,CAAC,KACD,iDAAwB,YAIvB,sDAAwB,YAAxB,mBAAiC,SAAjC,cAEG,aAAQ,MAAM,MAAd,mBAAiB,UAAS,QAAQ,MAAM,IAAI,QAAQ,MAAM,IAC9D,QAAQ,MAAM,MAPd,YAQC,CAAC;AAAA,GACR;AACK,IAAM,OAAO;AASb,IAAM,MAAuB,uBAAG;AA7DvC;AA6D0C,gBAAO,YAAY,cAEzD,SAAQ,gDAAwB,WAAxB,mBAAgC,gBAAe,cAGnD,6BAAsB,KAAK,GAAE,eAA7B,4CAA+C,CAAC,IAClD,CAAC,IACF,EAAE,2CAAwB,WACzB,QAAQ,KAAK,KACZ,MAAM;AAtEb,QAAAC,KAAAC,KAAAC,KAAAC,KAAA;AAuEM,QAAI;AAKF,cAAQ,MAAAD,OAAAD,OAAAD,MAAA,2CAAwB,YAAxB,gBAAAA,IAAiC,QAAjC,gBAAAC,IAAsC,aAAtC,gBAAAC,IAAA,KAAAD,SAAA,cAAuDE,MAAA,QAAQ,KAAK,MAAb,gBAAAA,IAAgB,aAAW,aAAQ,KAAK,MAAb,mBAAgB,aAAa,QAAQ,KAAK;AAAA,IACtI,SAAS,MAAM;AAAA,IAAe;AAC9B,WAAO,CAAC;AAAA,EACV,GAAG;AAAA,GACL;AAOK,IAAM,SAAmC,uBAC9C,CAAC,EAAE,2CAAwB,SAC3B;AAOK,IAAM,UAAoC,uBAC/C,CAAC,EAAE,2CAAwB,UAC3B;AAOK,IAAM,aAAuC,uBAClD,OAAO,eAAe,aACtB;AAOK,IAAM,UAAoC,uBAAG;AAlHpD;AAoHE;AAAA;AAAA,KAAC,UAAU,CAAC,WAAW,CAAC,GAAE,sDAAsB,eAAtB,mBAAkC,aAAlC,mBAA4C;AAAA;AAAA,GACtE;AAQK,IAAM,uBAAiD,uBAC5D,QAAQ,2CAAwB,sBAAqB,cAClD,QAAQ,2CAAwB,kBAAiB,aACpD;AAOK,IAAM,iBAA2C,uBACtD,CAAC,EAAE,2CAAwB,iBAC3B;",
|
|
6
6
|
"names": ["Object", "_a", "_b", "_c", "_d"]
|
|
7
7
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -25,4 +25,35 @@ export declare const ARGS: string[];
|
|
|
25
25
|
* @see {@link https://quickjs-ng.github.io/quickjs/stdlib#getenviron|getenviron - QuickJS-NG}
|
|
26
26
|
*/
|
|
27
27
|
export declare const ENV: ProcessEnv;
|
|
28
|
+
/**
|
|
29
|
+
* detects if running in the Bun runtime
|
|
30
|
+
* @see {@link https://bun.sh/docs/api/globals|Bun globals}
|
|
31
|
+
*/
|
|
32
|
+
export declare const IS_BUN: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* detects if running in the Deno runtime
|
|
35
|
+
* @see {@link https://docs.deno.com/api/deno/~/Deno|Deno}
|
|
36
|
+
*/
|
|
37
|
+
export declare const IS_DENO: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* detects if running in the QuickJs runtime
|
|
40
|
+
* @see {@link https://quickjs-ng.github.io/quickjs/stdlib/#globals}
|
|
41
|
+
*/
|
|
42
|
+
export declare const IS_QUICKJS: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* detects if running in Node.js
|
|
45
|
+
* @see {@link https://nodejs.org/api/process.html#processversions|process.versions docs}
|
|
46
|
+
*/
|
|
47
|
+
export declare const IS_NODE: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* detects if running inside Cloudflare Workers
|
|
50
|
+
* - Workers expose 'WebSocketPair' and lack 'navigator'
|
|
51
|
+
* @see {@link https://developers.cloudflare.com/workers/runtime-apis/websockets}
|
|
52
|
+
*/
|
|
53
|
+
export declare const IS_CLOUDFLARE_WORKER: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* detects if running inside Vercel Edge
|
|
56
|
+
* @see {@link https://vercel.com/docs/functions/runtimes/edge#check-if-you're-running-on-the-edge-runtime}
|
|
57
|
+
*/
|
|
58
|
+
export declare const IS_VERCEL_EDGE: boolean;
|
|
28
59
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -25,4 +25,35 @@ export declare const ARGS: string[];
|
|
|
25
25
|
* @see {@link https://quickjs-ng.github.io/quickjs/stdlib#getenviron|getenviron - QuickJS-NG}
|
|
26
26
|
*/
|
|
27
27
|
export declare const ENV: ProcessEnv;
|
|
28
|
+
/**
|
|
29
|
+
* detects if running in the Bun runtime
|
|
30
|
+
* @see {@link https://bun.sh/docs/api/globals|Bun globals}
|
|
31
|
+
*/
|
|
32
|
+
export declare const IS_BUN: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* detects if running in the Deno runtime
|
|
35
|
+
* @see {@link https://docs.deno.com/api/deno/~/Deno|Deno}
|
|
36
|
+
*/
|
|
37
|
+
export declare const IS_DENO: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* detects if running in the QuickJs runtime
|
|
40
|
+
* @see {@link https://quickjs-ng.github.io/quickjs/stdlib/#globals}
|
|
41
|
+
*/
|
|
42
|
+
export declare const IS_QUICKJS: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* detects if running in Node.js
|
|
45
|
+
* @see {@link https://nodejs.org/api/process.html#processversions|process.versions docs}
|
|
46
|
+
*/
|
|
47
|
+
export declare const IS_NODE: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* detects if running inside Cloudflare Workers
|
|
50
|
+
* - Workers expose 'WebSocketPair' and lack 'navigator'
|
|
51
|
+
* @see {@link https://developers.cloudflare.com/workers/runtime-apis/websockets}
|
|
52
|
+
*/
|
|
53
|
+
export declare const IS_CLOUDFLARE_WORKER: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* detects if running inside Vercel Edge
|
|
56
|
+
* @see {@link https://vercel.com/docs/functions/runtimes/edge#check-if-you're-running-on-the-edge-runtime}
|
|
57
|
+
*/
|
|
58
|
+
export declare const IS_VERCEL_EDGE: boolean;
|
|
28
59
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -25,4 +25,35 @@ export declare const ARGS: string[];
|
|
|
25
25
|
* @see {@link https://quickjs-ng.github.io/quickjs/stdlib#getenviron|getenviron - QuickJS-NG}
|
|
26
26
|
*/
|
|
27
27
|
export declare const ENV: ProcessEnv;
|
|
28
|
+
/**
|
|
29
|
+
* detects if running in the Bun runtime
|
|
30
|
+
* @see {@link https://bun.sh/docs/api/globals|Bun globals}
|
|
31
|
+
*/
|
|
32
|
+
export declare const IS_BUN: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* detects if running in the Deno runtime
|
|
35
|
+
* @see {@link https://docs.deno.com/api/deno/~/Deno|Deno}
|
|
36
|
+
*/
|
|
37
|
+
export declare const IS_DENO: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* detects if running in the QuickJs runtime
|
|
40
|
+
* @see {@link https://quickjs-ng.github.io/quickjs/stdlib/#globals}
|
|
41
|
+
*/
|
|
42
|
+
export declare const IS_QUICKJS: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* detects if running in Node.js
|
|
45
|
+
* @see {@link https://nodejs.org/api/process.html#processversions|process.versions docs}
|
|
46
|
+
*/
|
|
47
|
+
export declare const IS_NODE: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* detects if running inside Cloudflare Workers
|
|
50
|
+
* - Workers expose 'WebSocketPair' and lack 'navigator'
|
|
51
|
+
* @see {@link https://developers.cloudflare.com/workers/runtime-apis/websockets}
|
|
52
|
+
*/
|
|
53
|
+
export declare const IS_CLOUDFLARE_WORKER: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* detects if running inside Vercel Edge
|
|
56
|
+
* @see {@link https://vercel.com/docs/functions/runtimes/edge#check-if-you're-running-on-the-edge-runtime}
|
|
57
|
+
*/
|
|
58
|
+
export declare const IS_VERCEL_EDGE: boolean;
|
|
28
59
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACjD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAG3C;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAejB,UAAU,CAAC;AAGlB;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAerC,CAAC;AACJ,eAAO,MAAM,IAAI,UAAO,CAAC;AAEzB;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACjD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAG3C;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAejB,UAAU,CAAC;AAGlB;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAerC,CAAC;AACJ,eAAO,MAAM,IAAI,UAAO,CAAC;AAEzB;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,EAmBT,UAAU,CAAC;AAGlB;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,OAElB,CAAC;AAGJ;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,OAEnB,CAAC;AAGJ;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,OAEtB,CAAC;AAGJ;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,OAGnB,CAAC;AAGJ;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAGhC,CAAC;AAGJ;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,OAE1B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -25,10 +25,28 @@ var ENV = /* @__PURE__ */ (() => {
|
|
|
25
25
|
return {};
|
|
26
26
|
})();
|
|
27
27
|
})();
|
|
28
|
+
var IS_BUN = /* @__PURE__ */ (() => !!(GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["Bun"]))();
|
|
29
|
+
var IS_DENO = /* @__PURE__ */ (() => !!(GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["Deno"]))();
|
|
30
|
+
var IS_QUICKJS = /* @__PURE__ */ (() => typeof scriptArgs !== "undefined")();
|
|
31
|
+
var IS_NODE = /* @__PURE__ */ (() => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return (
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
+
!IS_BUN && !IS_DENO && !!((_b = (_a = GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["process"]) == null ? void 0 : _a.versions) == null ? void 0 : _b.node)
|
|
36
|
+
);
|
|
37
|
+
})();
|
|
38
|
+
var IS_CLOUDFLARE_WORKER = /* @__PURE__ */ (() => typeof (GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["WebSocketPair"]) === "function" && typeof (GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["navigator"]) === "undefined")();
|
|
39
|
+
var IS_VERCEL_EDGE = /* @__PURE__ */ (() => !!(GLOBAL_THIS == null ? void 0 : GLOBAL_THIS["EdgeRuntime"]))();
|
|
28
40
|
export {
|
|
29
41
|
ARGS,
|
|
30
42
|
ARGV,
|
|
31
43
|
ENV,
|
|
32
|
-
GLOBAL_THIS
|
|
44
|
+
GLOBAL_THIS,
|
|
45
|
+
IS_BUN,
|
|
46
|
+
IS_CLOUDFLARE_WORKER,
|
|
47
|
+
IS_DENO,
|
|
48
|
+
IS_NODE,
|
|
49
|
+
IS_QUICKJS,
|
|
50
|
+
IS_VERCEL_EDGE
|
|
33
51
|
};
|
|
34
52
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export type GlobalThis = typeof globalThis;\nexport type ProcessArgv = NodeJS.Process['argv'];\nexport type ProcessEnv = NodeJS.ProcessEnv;\n\n\n/**\n * globalThis object - with pollyfil in case of prehistoric node <12\n * @see {@link https://tc39.es/ecma262/multipage/global-object.html#sec-globalthis|globalThis spec - ECMAScript }\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis|globalThis docs - MDN}\n */\nexport const GLOBAL_THIS = /* @__PURE__ */ (() =>\n typeof globalThis === 'object'\n ? globalThis\n /**\n * globalThis pollyfill\n * @see {@link https://mathiasbynens.be/notes/globalthis}\n * @see {@link https://github.com/ungap/global-this}\n */\n : (() => {\n // @ts-expect-error - globalThis pollyfill for prehistoric node envs\n // eslint-disable-next-line\n !(function (Object) {function get() {const e = this || self; e.globalThis = e, delete Object.prototype._T_;}'object' != typeof globalThis && (this ? get() : (Object.defineProperty(Object.prototype, '_T_', {configurable:!0, get:get}), _T_));}(Object));\n // just in case\n return typeof globalThis === 'object' ? globalThis : {};\n })()\n)() as GlobalThis;\n\n\n/**\n * command-line arguments (pure/iffe wrapped so we can shake the tree)\n * @see {@link https://nodejs.org/api/process.html#processargv|process.argv - Node.js}\n * @see {@link https://bellard.org/quickjs/quickjs.html#Global-objects|scriptArgs - QuickJS}\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib#scriptargs|scriptArgs - QuickJS-NG}\n * @see {@link https://docs.deno.com/api/node/process/~/Process#property_argv|process.argv - Deno}\n * @see {@link https://docs.deno.com/api/deno/~/Deno.CommandOptions#property_args|Deno.args - Deno}\n */\nexport const ARGV: NodeJS.Process['argv'] = /* @__PURE__ */ (() =>\n typeof process === 'undefined'\n /** quickJs {@link https://bellard.org/quickjs/quickjs.html#Global-objects} */\n ? typeof scriptArgs !== 'undefined'\n ? scriptArgs\n : []\n : ((GLOBAL_THIS as never)?.['Deno']\n // @NOTE: DENO.args does not require any perm requests\n // @NOTE: if --allow-all is used, no args (like --allow-env), use default\n // @ts-expect-error deno uses 'args' rather than 'argv'\n ? (GLOBAL_THIS as never)?.['Deno']?.args\n // @ts-expect-error deno uses 'args' rather than 'argv'\n ?? (process['args']?.length ? process['args'] : process['argv'])\n : process['argv']\n ) ?? []\n)();\nexport const ARGS = ARGV;\n\n/**\n * process environment (ENV) variables\n * @see {@link https://nodejs.org/api/process.html#processenv|process.env - Node.js}\n * @see {@link https://docs.deno.com/runtime/reference/env_variables/#built-in-deno.env|env - Deno}\n * @see {@link https://bellard.org/quickjs/quickjs.html#Global-objects|getenviron - QuickJS}\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib#getenviron|getenviron - QuickJS-NG}\n */\nexport const ENV = /* @__PURE__ */ (() => typeof process === 'undefined'\n // @ts-expect-error quickjs std\n ? typeof (GLOBAL_THIS as never)?.['std']?.getenviron === 'function'\n // @ts-expect-error quickjs std\n ? ((GLOBAL_THIS as never)['std'].getenviron?.() ?? {})\n : {}\n : (!(GLOBAL_THIS as never)?.['Deno']\n ? process['env']\n : (() => {\n try {\n // @NOTE: if --allow-all is used, no toObject (like --allow-env), use default\n // @NOTE: DENO.env.toObject only requires one perm request while process requires many\n // @ts-expect-error deno perms\n // eslint-disable-next-line @stylistic/max-len\n return (GLOBAL_THIS as never)?.['Deno']?.env?.toObject?.() ?? (process['env']?.toObject ? process['env']?.toObject() : process['env']);\n } catch (_err) { /* ignore */ }\n return {};\n })())\n)() as ProcessEnv;\n"],
|
|
5
|
-
"mappings": ";AAUO,IAAM,cAA+B,uBAC1C,OAAO,eAAe,WAClB,cAMC,MAAM;AAGP,IAAE,SAAUA,SAAQ;AAAC,aAAS,MAAM;AAAC,YAAM,IAAI,QAAQ;AAAM,QAAE,aAAa,GAAG,OAAOA,QAAO,UAAU;AAAA,IAAI;AAAC,gBAAY,OAAO,eAAe,OAAO,IAAI,KAAKA,QAAO,eAAeA,QAAO,WAAW,OAAO,EAAC,cAAa,MAAI,IAAO,CAAC,GAAG;AAAA,EAAM,GAAE,MAAM;AAExP,SAAO,OAAO,eAAe,WAAW,aAAa,CAAC;AACxD,GAAG,GACL;AAWK,IAAM,OAAgD,uBAAG;AApChE;AAqCE,gBAAO,YAAY,cAEf,OAAO,eAAe,cACpB,aACA,CAAC,KACD,iDAAwB,YAIvB,sDAAwB,YAAxB,mBAAiC,SAAjC,cAEG,aAAQ,MAAM,MAAd,mBAAiB,UAAS,QAAQ,MAAM,IAAI,QAAQ,MAAM,IAC9D,QAAQ,MAAM,MAPd,YAQC,CAAC;AAAA,GACR;AACK,IAAM,OAAO;AASb,IAAM,MAAuB,uBAAG;AA7DvC;AA6D0C,gBAAO,YAAY,cAEzD,SAAQ,gDAAwB,WAAxB,mBAAgC,gBAAe,
|
|
4
|
+
"sourcesContent": ["export type GlobalThis = typeof globalThis;\nexport type ProcessArgv = NodeJS.Process['argv'];\nexport type ProcessEnv = NodeJS.ProcessEnv;\n\n\n/**\n * globalThis object - with pollyfil in case of prehistoric node <12\n * @see {@link https://tc39.es/ecma262/multipage/global-object.html#sec-globalthis|globalThis spec - ECMAScript }\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis|globalThis docs - MDN}\n */\nexport const GLOBAL_THIS = /* @__PURE__ */ (() =>\n typeof globalThis === 'object'\n ? globalThis\n /**\n * globalThis pollyfill\n * @see {@link https://mathiasbynens.be/notes/globalthis}\n * @see {@link https://github.com/ungap/global-this}\n */\n : (() => {\n // @ts-expect-error - globalThis pollyfill for prehistoric node envs\n // eslint-disable-next-line\n !(function (Object) {function get() {const e = this || self; e.globalThis = e, delete Object.prototype._T_;}'object' != typeof globalThis && (this ? get() : (Object.defineProperty(Object.prototype, '_T_', {configurable:!0, get:get}), _T_));}(Object));\n // just in case\n return typeof globalThis === 'object' ? globalThis : {};\n })()\n)() as GlobalThis;\n\n\n/**\n * command-line arguments (pure/iffe wrapped so we can shake the tree)\n * @see {@link https://nodejs.org/api/process.html#processargv|process.argv - Node.js}\n * @see {@link https://bellard.org/quickjs/quickjs.html#Global-objects|scriptArgs - QuickJS}\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib#scriptargs|scriptArgs - QuickJS-NG}\n * @see {@link https://docs.deno.com/api/node/process/~/Process#property_argv|process.argv - Deno}\n * @see {@link https://docs.deno.com/api/deno/~/Deno.CommandOptions#property_args|Deno.args - Deno}\n */\nexport const ARGV: NodeJS.Process['argv'] = /* @__PURE__ */ (() =>\n typeof process === 'undefined'\n /** quickJs {@link https://bellard.org/quickjs/quickjs.html#Global-objects} */\n ? typeof scriptArgs !== 'undefined'\n ? scriptArgs\n : []\n : ((GLOBAL_THIS as never)?.['Deno']\n // @NOTE: DENO.args does not require any perm requests\n // @NOTE: if --allow-all is used, no args (like --allow-env), use default\n // @ts-expect-error deno uses 'args' rather than 'argv'\n ? (GLOBAL_THIS as never)?.['Deno']?.args\n // @ts-expect-error deno uses 'args' rather than 'argv'\n ?? (process['args']?.length ? process['args'] : process['argv'])\n : process['argv']\n ) ?? []\n)();\nexport const ARGS = ARGV;\n\n/**\n * process environment (ENV) variables\n * @see {@link https://nodejs.org/api/process.html#processenv|process.env - Node.js}\n * @see {@link https://docs.deno.com/runtime/reference/env_variables/#built-in-deno.env|env - Deno}\n * @see {@link https://bellard.org/quickjs/quickjs.html#Global-objects|getenviron - QuickJS}\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib#getenviron|getenviron - QuickJS-NG}\n */\nexport const ENV = /* @__PURE__ */ (() => typeof process === 'undefined'\n // @ts-expect-error quickjs std\n ? typeof (GLOBAL_THIS as never)?.['std']?.getenviron === 'function'\n // @ts-expect-error quickjs std -> only works via 'qjs --std --module <file>'\n // if 'qjs --std --compile <file>'; 'getenviron' is only accessible via: import * as std from 'qjs:std'\n ? ((GLOBAL_THIS as never)['std'].getenviron?.() ?? {})\n : {}\n : (!(GLOBAL_THIS as never)?.['Deno']\n ? process['env']\n : (() => {\n try {\n // @NOTE: if --allow-all is used, no toObject (like --allow-env), use default\n // @NOTE: DENO.env.toObject only requires one perm request while process requires many\n // @ts-expect-error deno perms\n // eslint-disable-next-line @stylistic/max-len\n return (GLOBAL_THIS as never)?.['Deno']?.env?.toObject?.() ?? (process['env']?.toObject ? process['env']?.toObject() : process['env']);\n } catch (_err) { /* ignore */ }\n return {};\n })())\n)() as ProcessEnv;\n\n\n/**\n * detects if running in the Bun runtime\n * @see {@link https://bun.sh/docs/api/globals|Bun globals}\n */\nexport const IS_BUN: boolean = /* @__PURE__ */ (() =>\n !!(GLOBAL_THIS as never)?.['Bun']\n)();\n\n\n/**\n * detects if running in the Deno runtime\n * @see {@link https://docs.deno.com/api/deno/~/Deno|Deno}\n */\nexport const IS_DENO: boolean = /* @__PURE__ */ (() =>\n !!(GLOBAL_THIS as never)?.['Deno']\n)();\n\n\n/**\n * detects if running in the QuickJs runtime\n * @see {@link https://quickjs-ng.github.io/quickjs/stdlib/#globals}\n */\nexport const IS_QUICKJS: boolean = /* @__PURE__ */ (() =>\n typeof scriptArgs !== 'undefined'\n)();\n\n\n/**\n * detects if running in Node.js\n * @see {@link https://nodejs.org/api/process.html#processversions|process.versions docs}\n */\nexport const IS_NODE: boolean = /* @__PURE__ */ (() =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n !IS_BUN && !IS_DENO && !!(GLOBAL_THIS as any)?.['process']?.versions?.node\n)();\n\n\n/**\n * detects if running inside Cloudflare Workers\n * - Workers expose 'WebSocketPair' and lack 'navigator'\n * @see {@link https://developers.cloudflare.com/workers/runtime-apis/websockets}\n */\nexport const IS_CLOUDFLARE_WORKER: boolean = /* @__PURE__ */ (() =>\n typeof (GLOBAL_THIS as never)?.['WebSocketPair'] === 'function'\n && typeof (GLOBAL_THIS as never)?.['navigator'] === 'undefined'\n)();\n\n\n/**\n * detects if running inside Vercel Edge\n * @see {@link https://vercel.com/docs/functions/runtimes/edge#check-if-you're-running-on-the-edge-runtime}\n */\nexport const IS_VERCEL_EDGE: boolean = /* @__PURE__ */ (() =>\n !!(GLOBAL_THIS as never)?.['EdgeRuntime']\n)();\n"],
|
|
5
|
+
"mappings": ";AAUO,IAAM,cAA+B,uBAC1C,OAAO,eAAe,WAClB,cAMC,MAAM;AAGP,IAAE,SAAUA,SAAQ;AAAC,aAAS,MAAM;AAAC,YAAM,IAAI,QAAQ;AAAM,QAAE,aAAa,GAAG,OAAOA,QAAO,UAAU;AAAA,IAAI;AAAC,gBAAY,OAAO,eAAe,OAAO,IAAI,KAAKA,QAAO,eAAeA,QAAO,WAAW,OAAO,EAAC,cAAa,MAAI,IAAO,CAAC,GAAG;AAAA,EAAM,GAAE,MAAM;AAExP,SAAO,OAAO,eAAe,WAAW,aAAa,CAAC;AACxD,GAAG,GACL;AAWK,IAAM,OAAgD,uBAAG;AApChE;AAqCE,gBAAO,YAAY,cAEf,OAAO,eAAe,cACpB,aACA,CAAC,KACD,iDAAwB,YAIvB,sDAAwB,YAAxB,mBAAiC,SAAjC,cAEG,aAAQ,MAAM,MAAd,mBAAiB,UAAS,QAAQ,MAAM,IAAI,QAAQ,MAAM,IAC9D,QAAQ,MAAM,MAPd,YAQC,CAAC;AAAA,GACR;AACK,IAAM,OAAO;AASb,IAAM,MAAuB,uBAAG;AA7DvC;AA6D0C,gBAAO,YAAY,cAEzD,SAAQ,gDAAwB,WAAxB,mBAAgC,gBAAe,cAGnD,6BAAsB,KAAK,GAAE,eAA7B,4CAA+C,CAAC,IAClD,CAAC,IACF,EAAE,2CAAwB,WACzB,QAAQ,KAAK,KACZ,MAAM;AAtEb,QAAAC,KAAAC,KAAAC,KAAAC,KAAA;AAuEM,QAAI;AAKF,cAAQ,MAAAD,OAAAD,OAAAD,MAAA,2CAAwB,YAAxB,gBAAAA,IAAiC,QAAjC,gBAAAC,IAAsC,aAAtC,gBAAAC,IAAA,KAAAD,SAAA,cAAuDE,MAAA,QAAQ,KAAK,MAAb,gBAAAA,IAAgB,aAAW,aAAQ,KAAK,MAAb,mBAAgB,aAAa,QAAQ,KAAK;AAAA,IACtI,SAAS,MAAM;AAAA,IAAe;AAC9B,WAAO,CAAC;AAAA,EACV,GAAG;AAAA,GACL;AAOK,IAAM,SAAmC,uBAC9C,CAAC,EAAE,2CAAwB,SAC3B;AAOK,IAAM,UAAoC,uBAC/C,CAAC,EAAE,2CAAwB,UAC3B;AAOK,IAAM,aAAuC,uBAClD,OAAO,eAAe,aACtB;AAOK,IAAM,UAAoC,uBAAG;AAlHpD;AAoHE;AAAA;AAAA,KAAC,UAAU,CAAC,WAAW,CAAC,GAAE,sDAAsB,eAAtB,mBAAkC,aAAlC,mBAA4C;AAAA;AAAA,GACtE;AAQK,IAAM,uBAAiD,uBAC5D,QAAQ,2CAAwB,sBAAqB,cAClD,QAAQ,2CAAwB,kBAAiB,aACpD;AAOK,IAAM,iBAA2C,uBACtD,CAAC,EAAE,2CAAwB,iBAC3B;",
|
|
6
6
|
"names": ["Object", "_a", "_b", "_c", "_d"]
|
|
7
7
|
}
|
package/package.json
CHANGED
package/dist/index.min.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var d=(o,e)=>{for(var r in e)c(o,r,{get:e[r],enumerable:!0})},h=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of b(e))!y.call(o,n)&&n!==r&&c(o,n,{get:()=>e[n],enumerable:!(t=f(e,n))||t.enumerable});return o};var u=o=>h(c({},"__esModule",{value:!0}),o);var j={};d(j,{ARGS:()=>x,ARGV:()=>v,ENV:()=>P,GLOBAL_THIS:()=>s});module.exports=u(j);var s=typeof globalThis=="object"?globalThis:((function(o){function e(){let r=this||self;r.globalThis=r,delete o.prototype._T_}typeof globalThis!="object"&&(this?e():(o.defineProperty(o.prototype,"_T_",{configurable:!0,get:e}),_T_))})(Object),typeof globalThis=="object"?globalThis:{}),v=(()=>{var o,e,r,t;return typeof process>"u"?typeof scriptArgs<"u"?scriptArgs:[]:(t=s!=null&&s.Deno?(r=(o=s==null?void 0:s.Deno)==null?void 0:o.args)!=null?r:(e=process.args)!=null&&e.length?process.args:process.argv:process.argv)!=null?t:[]})(),x=v,P=(()=>{var o,e,r,t;return typeof process>"u"?typeof((o=s==null?void 0:s.std)==null?void 0:o.getenviron)=="function"?(t=(r=(e=s.std).getenviron)==null?void 0:r.call(e))!=null?t:{}:{}:s!=null&&s.Deno?(()=>{var n,p,a,g,i,l;try{return(l=(a=(p=(n=s==null?void 0:s.Deno)==null?void 0:n.env)==null?void 0:p.toObject)==null?void 0:a.call(p))!=null?l:(g=process.env)!=null&&g.toObject?(i=process.env)==null?void 0:i.toObject():process.env}catch{}return{}})():process.env})();0&&(module.exports={ARGS,ARGV,ENV,GLOBAL_THIS});
|
package/dist/index.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=typeof globalThis=="object"?globalThis:((function(o){function s(){let r=this||self;r.globalThis=r,delete o.prototype._T_}typeof globalThis!="object"&&(this?s():(o.defineProperty(o.prototype,"_T_",{configurable:!0,get:s}),_T_))})(Object),typeof globalThis=="object"?globalThis:{}),l=(()=>{var o,s,r,t;return typeof process>"u"?typeof scriptArgs<"u"?scriptArgs:[]:(t=e!=null&&e.Deno?(r=(o=e==null?void 0:e.Deno)==null?void 0:o.args)!=null?r:(s=process.args)!=null&&s.length?process.args:process.argv:process.argv)!=null?t:[]})(),f=l,b=(()=>{var o,s,r,t;return typeof process>"u"?typeof((o=e==null?void 0:e.std)==null?void 0:o.getenviron)=="function"?(t=(r=(s=e.std).getenviron)==null?void 0:r.call(s))!=null?t:{}:{}:e!=null&&e.Deno?(()=>{var p,n,c,a,g,i;try{return(i=(c=(n=(p=e==null?void 0:e.Deno)==null?void 0:p.env)==null?void 0:n.toObject)==null?void 0:c.call(n))!=null?i:(a=process.env)!=null&&a.toObject?(g=process.env)==null?void 0:g.toObject():process.env}catch{}return{}})():process.env})();export{f as ARGS,l as ARGV,b as ENV,e as GLOBAL_THIS};
|