@xylabs/platform 3.6.12 → 4.0.1

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.
@@ -1,6 +1,8 @@
1
- import type { subtle as subtleType } from 'node:crypto';
2
- export declare const isBrowser: () => boolean;
3
- export declare const isWebworker: () => boolean;
4
- export declare const getGlobal: <T extends object>() => typeof globalThis | T;
5
- export declare const subtle: typeof subtleType;
6
- //# sourceMappingURL=index.d.ts.map
1
+ import { subtle as subtle$1 } from 'node:crypto';
2
+
3
+ declare const isBrowser: () => boolean;
4
+ declare const isWebworker: () => boolean;
5
+ declare const getGlobal: <T extends object>() => typeof globalThis | T;
6
+ declare const subtle: typeof subtle$1;
7
+
8
+ export { getGlobal, isBrowser, isWebworker, subtle };
@@ -1,5 +1,7 @@
1
1
  export { subtle } from 'node:crypto';
2
- export declare const isBrowser: () => boolean;
3
- export declare const isWebworker: () => boolean;
4
- export declare const getGlobal: <T extends object>() => typeof globalThis | T;
5
- //# sourceMappingURL=index.d.ts.map
2
+
3
+ declare const isBrowser: () => boolean;
4
+ declare const isWebworker: () => boolean;
5
+ declare const getGlobal: <T extends object>() => typeof globalThis | T;
6
+
7
+ export { getGlobal, isBrowser, isWebworker };
package/package.json CHANGED
@@ -14,39 +14,20 @@
14
14
  "exports": {
15
15
  ".": {
16
16
  "browser": {
17
- "require": {
18
- "types": "./dist/browser/index.d.cts",
19
- "default": "./dist/browser/index.cjs"
20
- },
21
- "import": {
22
- "types": "./dist/browser/index.d.ts",
23
- "default": "./dist/browser/index.mjs"
24
- }
17
+ "types": "./dist/browser/index.d.ts",
18
+ "default": "./dist/browser/index.mjs"
25
19
  },
26
20
  "neutral": {
27
- "require": {
28
- "types": "./dist/browser/index.d.cts",
29
- "default": "./dist/browser/index.cjs"
30
- },
31
- "import": {
32
- "types": "./dist/browser/index.d.ts",
33
- "default": "./dist/browser/index.mjs"
34
- }
21
+ "types": "./dist/browser/index.d.ts",
22
+ "default": "./dist/browser/index.mjs"
35
23
  },
36
24
  "node": {
37
- "require": {
38
- "types": "./dist/node/index.d.cts",
39
- "default": "./dist/node/index.cjs"
40
- },
41
- "import": {
42
- "types": "./dist/node/index.d.ts",
43
- "default": "./dist/node/index.mjs"
44
- }
25
+ "types": "./dist/node/index.d.ts",
26
+ "default": "./dist/node/index.mjs"
45
27
  }
46
28
  },
47
29
  "./package.json": "./package.json"
48
30
  },
49
- "main": "./dist/browser/index.cjs",
50
31
  "types": "./dist/browser/index.d.ts",
51
32
  "module": "./dist/browser/index.mjs",
52
33
  "homepage": "https://xylabs.com",
@@ -58,9 +39,9 @@
58
39
  "esm"
59
40
  ],
60
41
  "devDependencies": {
61
- "@xylabs/ts-scripts-yarn3": "^3.15.14",
62
- "@xylabs/tsconfig": "^3.15.14",
63
- "@xylabs/tsconfig-dom": "^3.15.14",
42
+ "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.15",
43
+ "@xylabs/tsconfig": "^4.0.0-rc.15",
44
+ "@xylabs/tsconfig-dom": "^4.0.0-rc.15",
64
45
  "typescript": "^5.5.4"
65
46
  },
66
47
  "engines": {
@@ -74,6 +55,6 @@
74
55
  "url": "https://github.com/xylabs/sdk-js.git"
75
56
  },
76
57
  "sideEffects": false,
77
- "version": "3.6.12",
58
+ "version": "4.0.1",
78
59
  "type": "module"
79
60
  }
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/browser/index.ts
21
- var browser_exports = {};
22
- __export(browser_exports, {
23
- getGlobal: () => getGlobal,
24
- isBrowser: () => isBrowser,
25
- isWebworker: () => isWebworker,
26
- subtle: () => subtle
27
- });
28
- module.exports = __toCommonJS(browser_exports);
29
- var isBrowser = () => {
30
- return !isWebworker() && self.constructor?.name === "Window";
31
- };
32
- var isWebworker = () => {
33
- return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
34
- };
35
- var getGlobal = () => isWebworker() ? self : isBrowser() ? window : globalThis;
36
- var subtle = getGlobal().crypto.subtle;
37
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/browser/index.ts"],"sourcesContent":["import type { subtle as subtleType } from 'node:crypto'\n\nexport const isBrowser = () => {\n return !isWebworker() && self.constructor?.name === 'Window'\n}\n\nexport const isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const getGlobal = <T extends object>() =>\n isWebworker()\n ? (self as unknown as T)\n : isBrowser()\n ? (window as unknown as T)\n : globalThis\n\nexport const subtle = getGlobal<Window>().crypto.subtle as typeof subtleType\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAM,YAAY,MAAM;AAC7B,SAAO,CAAC,YAAY,KAAK,KAAK,aAAa,SAAS;AACtD;AAEO,IAAM,cAAc,MAAM;AAC/B,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,IAAM,YAAY,MACvB,YAAY,IACP,OACD,UAAU,IACP,SACD;AAED,IAAM,SAAS,UAAkB,EAAE,OAAO;","names":[]}
@@ -1,6 +0,0 @@
1
- import type { subtle as subtleType } from 'node:crypto';
2
- export declare const isBrowser: () => boolean;
3
- export declare const isWebworker: () => boolean;
4
- export declare const getGlobal: <T extends object>() => typeof globalThis | T;
5
- export declare const subtle: typeof subtleType;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,SAAS,GAAI,CAAC,SAAS,MAAM,4BAKxB,CAAA;AAElB,eAAO,MAAM,MAAM,EAAwC,OAAO,UAAU,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { subtle as subtleType } from 'node:crypto';
2
- export declare const isBrowser: () => boolean;
3
- export declare const isWebworker: () => boolean;
4
- export declare const getGlobal: <T extends object>() => typeof globalThis | T;
5
- export declare const subtle: typeof subtleType;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,SAAS,GAAI,CAAC,SAAS,MAAM,4BAKxB,CAAA;AAElB,eAAO,MAAM,MAAM,EAAwC,OAAO,UAAU,CAAA"}
@@ -1 +0,0 @@
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,SAAS,GAAI,CAAC,SAAS,MAAM,4BAKxB,CAAA;AAElB,eAAO,MAAM,MAAM,EAAwC,OAAO,UAAU,CAAA"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/node/index.ts
21
- var node_exports = {};
22
- __export(node_exports, {
23
- getGlobal: () => getGlobal,
24
- isBrowser: () => isBrowser,
25
- isWebworker: () => isWebworker,
26
- subtle: () => import_node_crypto.subtle
27
- });
28
- module.exports = __toCommonJS(node_exports);
29
- var import_node_crypto = require("crypto");
30
- var isBrowser = () => {
31
- return false;
32
- };
33
- var isWebworker = () => {
34
- return false;
35
- };
36
- var getGlobal = () => isBrowser() ? window : isWebworker() ? self : globalThis;
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- getGlobal,
40
- isBrowser,
41
- isWebworker,
42
- subtle
43
- });
44
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
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 getGlobal = <T extends object>() =>\n isBrowser()\n ? (window as unknown as T)\n : isWebworker()\n ? (self as unknown as T)\n : globalThis\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAuB;AAEhB,IAAM,YAAY,MAAM;AAC7B,SAAO;AACT;AAEO,IAAM,cAAc,MAAM;AAC/B,SAAO;AACT;AAEO,IAAM,YAAY,MACvB,UAAU,IACL,SACD,YAAY,IACT,OACD;","names":[]}
@@ -1,5 +0,0 @@
1
- export { subtle } from 'node:crypto';
2
- export declare const isBrowser: () => boolean;
3
- export declare const isWebworker: () => boolean;
4
- export declare const getGlobal: <T extends object>() => typeof globalThis | T;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,SAAS,GAAI,CAAC,SAAS,MAAM,4BAKxB,CAAA"}
@@ -1,5 +0,0 @@
1
- export { subtle } from 'node:crypto';
2
- export declare const isBrowser: () => boolean;
3
- export declare const isWebworker: () => boolean;
4
- export declare const getGlobal: <T extends object>() => typeof globalThis | T;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,SAAS,GAAI,CAAC,SAAS,MAAM,4BAKxB,CAAA"}
@@ -1 +0,0 @@
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,SAAS,GAAI,CAAC,SAAS,MAAM,4BAKxB,CAAA"}