@xylabs/platform 2.12.27 → 2.12.29
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/index.cjs +7 -5
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +2 -0
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +2 -0
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +4 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +9 -6
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +1 -0
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +1 -0
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +4 -2
- package/dist/node/index.js.map +1 -1
- package/package.json +5 -5
- package/src/browser/index.ts +14 -0
- package/src/{index.ts → node/index.ts} +2 -0
- package/xy.config.ts +14 -0
package/dist/browser/index.cjs
CHANGED
|
@@ -17,14 +17,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
20
|
+
// src/browser/index.ts
|
|
21
|
+
var browser_exports = {};
|
|
22
|
+
__export(browser_exports, {
|
|
23
23
|
getGlobal: () => getGlobal,
|
|
24
24
|
isBrowser: () => isBrowser,
|
|
25
|
-
isWebworker: () => isWebworker
|
|
25
|
+
isWebworker: () => isWebworker,
|
|
26
|
+
subtle: () => subtle
|
|
26
27
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
28
|
+
module.exports = __toCommonJS(browser_exports);
|
|
28
29
|
var isBrowser = () => {
|
|
29
30
|
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
30
31
|
};
|
|
@@ -32,4 +33,5 @@ var isWebworker = () => {
|
|
|
32
33
|
return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
33
34
|
};
|
|
34
35
|
var getGlobal = () => isBrowser() ? window : isWebworker() ? self : globalThis;
|
|
36
|
+
var subtle = getGlobal().subtle;
|
|
35
37
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/browser/index.ts"],"sourcesContent":["import type { subtle as subtleType } from 'crypto'\n\nexport const isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nexport const isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const getGlobal = <T extends object>() => (isBrowser() ? (window as unknown as T) : isWebworker() ? (self as unknown as T) : globalThis)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const subtle = (getGlobal() as any).subtle as typeof subtleType\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAM,YAAY,MAAM;AAC7B,SAAO,OAAO,WAAW,eAAe,OAAO,QAAQ,aAAa;AACtE;AAEO,IAAM,cAAc,MAAM;AAC/B,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,IAAM,YAAY,MAAyB,UAAU,IAAK,SAA0B,YAAY,IAAK,OAAwB;AAG7H,IAAM,SAAU,UAAU,EAAU;","names":[]}
|
package/dist/browser/index.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
export declare const isBrowser: () => boolean;
|
|
2
3
|
export declare const isWebworker: () => boolean;
|
|
3
4
|
export declare const getGlobal: <T extends object>() => typeof globalThis | T;
|
|
5
|
+
export declare const subtle: import("crypto").webcrypto.SubtleCrypto;
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA;AAG/I,eAAO,MAAM,MAAM,yCAAmD,CAAA"}
|
package/dist/browser/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
export declare const isBrowser: () => boolean;
|
|
2
3
|
export declare const isWebworker: () => boolean;
|
|
3
4
|
export declare const getGlobal: <T extends object>() => typeof globalThis | T;
|
|
5
|
+
export declare const subtle: import("crypto").webcrypto.SubtleCrypto;
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA;AAG/I,eAAO,MAAM,MAAM,yCAAmD,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
export declare const isBrowser: () => boolean;
|
|
2
3
|
export declare const isWebworker: () => boolean;
|
|
3
4
|
export declare const getGlobal: <T extends object>() => typeof globalThis | T;
|
|
5
|
+
export declare const subtle: import("crypto").webcrypto.SubtleCrypto;
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA;AAG/I,eAAO,MAAM,MAAM,yCAAmD,CAAA"}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/index.ts
|
|
1
|
+
// src/browser/index.ts
|
|
2
2
|
var isBrowser = () => {
|
|
3
3
|
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
4
4
|
};
|
|
@@ -6,9 +6,11 @@ var isWebworker = () => {
|
|
|
6
6
|
return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
7
7
|
};
|
|
8
8
|
var getGlobal = () => isBrowser() ? window : isWebworker() ? self : globalThis;
|
|
9
|
+
var subtle = getGlobal().subtle;
|
|
9
10
|
export {
|
|
10
11
|
getGlobal,
|
|
11
12
|
isBrowser,
|
|
12
|
-
isWebworker
|
|
13
|
+
isWebworker,
|
|
14
|
+
subtle
|
|
13
15
|
};
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/browser/index.ts"],"sourcesContent":["import type { subtle as subtleType } from 'crypto'\n\nexport const isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nexport const isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const getGlobal = <T extends object>() => (isBrowser() ? (window as unknown as T) : isWebworker() ? (self as unknown as T) : globalThis)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const subtle = (getGlobal() as any).subtle as typeof subtleType\n"],"mappings":";AAEO,IAAM,YAAY,MAAM;AAC7B,SAAO,OAAO,WAAW,eAAe,OAAO,QAAQ,aAAa;AACtE;AAEO,IAAM,cAAc,MAAM;AAC/B,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,IAAM,YAAY,MAAyB,UAAU,IAAK,SAA0B,YAAY,IAAK,OAAwB;AAG7H,IAAM,SAAU,UAAU,EAAU;","names":[]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -17,14 +17,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
20
|
+
// src/node/index.ts
|
|
21
|
+
var node_exports = {};
|
|
22
|
+
__export(node_exports, {
|
|
23
23
|
getGlobal: () => getGlobal,
|
|
24
24
|
isBrowser: () => isBrowser,
|
|
25
|
-
isWebworker: () => isWebworker
|
|
25
|
+
isWebworker: () => isWebworker,
|
|
26
|
+
subtle: () => import_crypto.subtle
|
|
26
27
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
28
|
+
module.exports = __toCommonJS(node_exports);
|
|
29
|
+
var import_crypto = require("crypto");
|
|
28
30
|
var isBrowser = () => {
|
|
29
31
|
return typeof window !== "undefined" && typeof (window == null ? void 0 : window.document) !== "undefined";
|
|
30
32
|
};
|
|
@@ -37,6 +39,7 @@ var getGlobal = () => isBrowser() ? window : isWebworker() ? self : globalThis;
|
|
|
37
39
|
0 && (module.exports = {
|
|
38
40
|
getGlobal,
|
|
39
41
|
isBrowser,
|
|
40
|
-
isWebworker
|
|
42
|
+
isWebworker,
|
|
43
|
+
subtle
|
|
41
44
|
});
|
|
42
45
|
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export const isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nexport const isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const getGlobal = <T extends object>() => (isBrowser() ? (window as unknown as T) : isWebworker() ? (self as unknown as T) : globalThis)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/node/index.ts"],"sourcesContent":["export { subtle } from 'crypto'\n\nexport const isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nexport const isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const getGlobal = <T extends object>() => (isBrowser() ? (window as unknown as T) : isWebworker() ? (self as unknown as T) : globalThis)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AAEhB,IAAM,YAAY,MAAM;AAC7B,SAAO,OAAO,WAAW,eAAe,QAAO,iCAAQ,cAAa;AACtE;AAEO,IAAM,cAAc,MAAM;AANjC;AAOE,SAAO,OAAO,SAAS,cAAY,UAAK,gBAAL,mBAAkB,UAAS;AAChE;AAEO,IAAM,YAAY,MAAyB,UAAU,IAAK,SAA0B,YAAY,IAAK,OAAwB;","names":[]}
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA"}
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA"}
|
package/dist/node/index.d.ts
CHANGED
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,eAAO,MAAM,SAAS,eAErB,CAAA;AAED,eAAO,MAAM,WAAW,eAEvB,CAAA;AAED,eAAO,MAAM,SAAS,+CAAyH,CAAA"}
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// src/index.ts
|
|
1
|
+
// src/node/index.ts
|
|
2
|
+
import { subtle } from "crypto";
|
|
2
3
|
var isBrowser = () => {
|
|
3
4
|
return typeof window !== "undefined" && typeof (window == null ? void 0 : window.document) !== "undefined";
|
|
4
5
|
};
|
|
@@ -10,6 +11,7 @@ var getGlobal = () => isBrowser() ? window : isWebworker() ? self : globalThis;
|
|
|
10
11
|
export {
|
|
11
12
|
getGlobal,
|
|
12
13
|
isBrowser,
|
|
13
|
-
isWebworker
|
|
14
|
+
isWebworker,
|
|
15
|
+
subtle
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export const isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nexport const isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const getGlobal = <T extends object>() => (isBrowser() ? (window as unknown as T) : isWebworker() ? (self as unknown as T) : globalThis)\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/node/index.ts"],"sourcesContent":["export { subtle } from 'crypto'\n\nexport const isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nexport const isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const getGlobal = <T extends object>() => (isBrowser() ? (window as unknown as T) : isWebworker() ? (self as unknown as T) : globalThis)\n"],"mappings":";AAAA,SAAS,cAAc;AAEhB,IAAM,YAAY,MAAM;AAC7B,SAAO,OAAO,WAAW,eAAe,QAAO,iCAAQ,cAAa;AACtE;AAEO,IAAM,cAAc,MAAM;AANjC;AAOE,SAAO,OAAO,SAAS,cAAY,UAAK,gBAAL,mBAAkB,UAAS;AAChE;AAEO,IAAM,YAAY,MAAyB,UAAU,IAAK,SAA0B,YAAY,IAAK,OAAwB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"license": "LGPL-3.0",
|
|
2
|
+
"license": "LGPL-3.0-only",
|
|
3
3
|
"name": "@xylabs/platform",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "support@xylabs.com",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"esm"
|
|
47
47
|
],
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@xylabs/ts-scripts-yarn3": "^3.1.
|
|
50
|
-
"@xylabs/tsconfig": "^3.1.
|
|
51
|
-
"@xylabs/tsconfig-dom": "^3.1.
|
|
49
|
+
"@xylabs/ts-scripts-yarn3": "^3.1.12",
|
|
50
|
+
"@xylabs/tsconfig": "^3.1.12",
|
|
51
|
+
"@xylabs/tsconfig-dom": "^3.1.12",
|
|
52
52
|
"typescript": "^5.2.2"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
@@ -59,6 +59,6 @@
|
|
|
59
59
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
|
-
"version": "2.12.
|
|
62
|
+
"version": "2.12.29",
|
|
63
63
|
"type": "module"
|
|
64
64
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { subtle as subtleType } from 'crypto'
|
|
2
|
+
|
|
3
|
+
export const isBrowser = () => {
|
|
4
|
+
return typeof window !== 'undefined' && typeof window?.document !== 'undefined'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const isWebworker = () => {
|
|
8
|
+
return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getGlobal = <T extends object>() => (isBrowser() ? (window as unknown as T) : isWebworker() ? (self as unknown as T) : globalThis)
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
export const subtle = (getGlobal() as any).subtle as typeof subtleType
|
package/xy.config.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
|
|
2
|
+
const config: XyTsupConfig = {
|
|
3
|
+
compile: {
|
|
4
|
+
browser: {
|
|
5
|
+
'src/browser': true,
|
|
6
|
+
},
|
|
7
|
+
node: {
|
|
8
|
+
'src/node': true,
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line import/no-default-export
|
|
14
|
+
export default config
|