@xylabs/platform 5.0.9 → 5.0.11
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/browser/browser/index.d.ts +1 -0
- package/dist/browser/browser/index.d.ts.map +1 -1
- package/dist/browser/index-browser.mjs +4 -0
- package/dist/browser/index-browser.mjs.map +1 -1
- package/dist/browser/node/index.d.ts +1 -0
- package/dist/browser/node/index.d.ts.map +1 -1
- package/dist/node/browser/index.d.ts +1 -0
- package/dist/node/browser/index.d.ts.map +1 -1
- package/dist/node/index-node.mjs +4 -0
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/node/index.d.ts +1 -0
- package/dist/node/node/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/browser/index.ts +4 -0
- package/src/node/index.ts +4 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { subtle as subtleType } from 'node:crypto';
|
|
2
2
|
export declare const isBrowser: () => boolean;
|
|
3
3
|
export declare const isWebworker: () => boolean;
|
|
4
|
+
export declare const isNode: () => boolean;
|
|
4
5
|
export declare const subtle: typeof subtleType;
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,MAAM,EAA+B,OAAO,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,MAAM,eAElB,CAAA;AAED,eAAO,MAAM,MAAM,EAA+B,OAAO,UAAU,CAAA"}
|
|
@@ -5,9 +5,13 @@ var isBrowser = () => {
|
|
|
5
5
|
var isWebworker = () => {
|
|
6
6
|
return typeof globalThis === "object" && globalThis.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
7
7
|
};
|
|
8
|
+
var isNode = () => {
|
|
9
|
+
return false;
|
|
10
|
+
};
|
|
8
11
|
var subtle = globalThis.crypto.subtle;
|
|
9
12
|
export {
|
|
10
13
|
isBrowser,
|
|
14
|
+
isNode,
|
|
11
15
|
isWebworker,
|
|
12
16
|
subtle
|
|
13
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/browser/index.ts"],"sourcesContent":["import type { subtle as subtleType } from 'node:crypto'\n\nexport const isBrowser = () => {\n return !isWebworker() && globalThis.constructor?.name === 'Window'\n}\n\nexport const isWebworker = () => {\n return typeof globalThis === 'object' && globalThis.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const subtle = globalThis.crypto.subtle as typeof subtleType\n"],"mappings":";AAEO,IAAM,YAAY,MAAM;AAC7B,SAAO,CAAC,YAAY,KAAK,WAAW,aAAa,SAAS;AAC5D;AAEO,IAAM,cAAc,MAAM;AAC/B,SAAO,OAAO,eAAe,YAAY,WAAW,aAAa,SAAS;AAC5E;AAEO,IAAM,SAAS,WAAW,OAAO;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/browser/index.ts"],"sourcesContent":["import type { subtle as subtleType } from 'node:crypto'\n\nexport const isBrowser = () => {\n return !isWebworker() && globalThis.constructor?.name === 'Window'\n}\n\nexport const isWebworker = () => {\n return typeof globalThis === 'object' && globalThis.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const isNode = () => {\n return false\n}\n\nexport const subtle = globalThis.crypto.subtle as typeof subtleType\n"],"mappings":";AAEO,IAAM,YAAY,MAAM;AAC7B,SAAO,CAAC,YAAY,KAAK,WAAW,aAAa,SAAS;AAC5D;AAEO,IAAM,cAAc,MAAM;AAC/B,SAAO,OAAO,eAAe,YAAY,WAAW,aAAa,SAAS;AAC5E;AAEO,IAAM,SAAS,MAAM;AAC1B,SAAO;AACT;AAEO,IAAM,SAAS,WAAW,OAAO;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,MAAM,eAElB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { subtle as subtleType } from 'node:crypto';
|
|
2
2
|
export declare const isBrowser: () => boolean;
|
|
3
3
|
export declare const isWebworker: () => boolean;
|
|
4
|
+
export declare const isNode: () => boolean;
|
|
4
5
|
export declare const subtle: typeof subtleType;
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,MAAM,EAA+B,OAAO,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,MAAM,eAElB,CAAA;AAED,eAAO,MAAM,MAAM,EAA+B,OAAO,UAAU,CAAA"}
|
package/dist/node/index-node.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/node/index.ts"],"sourcesContent":["export { subtle } from 'node:crypto'\n\nexport const isBrowser = () => {\n return false\n}\n\nexport const isWebworker = () => {\n return false\n}\n"],"mappings":";AAAA,SAAS,cAAc;AAEhB,IAAM,YAAY,MAAM;AAC7B,SAAO;AACT;AAEO,IAAM,cAAc,MAAM;AAC/B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/node/index.ts"],"sourcesContent":["export { subtle } from 'node:crypto'\n\nexport const isBrowser = () => {\n return false\n}\n\nexport const isWebworker = () => {\n return false\n}\n\nexport const isNode = () => {\n return true\n}\n"],"mappings":";AAAA,SAAS,cAAc;AAEhB,IAAM,YAAY,MAAM;AAC7B,SAAO;AACT;AAEO,IAAM,cAAc,MAAM;AAC/B,SAAO;AACT;AAEO,IAAM,SAAS,MAAM;AAC1B,SAAO;AACT;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,MAAM,eAElB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/platform",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.11",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"platform",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"src"
|
|
50
50
|
],
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/node": "~24.
|
|
53
|
-
"@xylabs/ts-scripts-yarn3": "~7.1.
|
|
54
|
-
"@xylabs/tsconfig": "~7.1.
|
|
52
|
+
"@types/node": "~24.3.0",
|
|
53
|
+
"@xylabs/ts-scripts-yarn3": "~7.1.7",
|
|
54
|
+
"@xylabs/tsconfig": "~7.1.7",
|
|
55
55
|
"typescript": "~5.9.2"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
package/src/browser/index.ts
CHANGED
|
@@ -8,4 +8,8 @@ export const isWebworker = () => {
|
|
|
8
8
|
return typeof globalThis === 'object' && globalThis.constructor?.name === 'DedicatedWorkerGlobalScope'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
export const isNode = () => {
|
|
12
|
+
return false
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
export const subtle = globalThis.crypto.subtle as typeof subtleType
|