@xylabs/crypto 2.12.8 → 2.12.10

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.
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/browser/Crypto.ts
29
31
  var Crypto_exports = {};
30
32
  __export(Crypto_exports, {
31
33
  Crypto: () => import_crypto_js.default
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/browser/Crypto.ts"],"sourcesContent":["import Crypto from 'crypto-js'\n\nexport { Crypto }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iCAAAA;AAAA;AAAA;AAAA,uBAAmB;","names":["Crypto"]}
1
+ {"version":3,"sources":["../../src/browser/Crypto.ts"],"sourcesContent":["import Crypto from 'crypto-js'\n\nexport { Crypto }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iCAAAA;AAAA;AAAA;AAAA,uBAAmB;","names":["Crypto"]}
@@ -0,0 +1,3 @@
1
+ import Crypto from 'crypto-js';
2
+ export { Crypto };
3
+ //# sourceMappingURL=Crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Crypto.d.ts","sourceRoot":"","sources":["../../../src/browser/Crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const cryptoPolyfill: () => void;
2
+ //# sourceMappingURL=cryptoPolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cryptoPolyfill.d.ts","sourceRoot":"","sources":["../../../src/browser/cryptoPolyfill.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,cAAc,YAS1B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './Crypto';
2
+ export * from './cryptoPolyfill';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA"}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,26 +17,40 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/browser/cryptoPolyfill.ts
19
31
  var cryptoPolyfill_exports = {};
20
32
  __export(cryptoPolyfill_exports, {
21
33
  cryptoPolyfill: () => cryptoPolyfill
22
34
  });
23
35
  module.exports = __toCommonJS(cryptoPolyfill_exports);
24
- var import_Crypto = require("./Crypto");
25
- const isBrowser = () => {
36
+
37
+ // src/browser/Crypto.ts
38
+ var import_crypto_js = __toESM(require("crypto-js"), 1);
39
+
40
+ // src/browser/cryptoPolyfill.ts
41
+ var isBrowser = () => {
26
42
  return typeof window !== "undefined" && typeof window?.document !== "undefined";
27
43
  };
28
- const isWebworker = () => {
44
+ var isWebworker = () => {
29
45
  return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
30
46
  };
31
- const cryptoPolyfill = () => {
47
+ var cryptoPolyfill = () => {
32
48
  const global = isBrowser() ? window : isWebworker() ? self : void 0;
33
49
  if (global) {
34
50
  if (global.Crypto === void 0) {
35
- global.Crypto = import_Crypto.Crypto;
51
+ global.Crypto = import_crypto_js.default;
36
52
  } else {
37
- global.Crypto = { ...import_Crypto.Crypto, ...global.Crypto };
53
+ global.Crypto = { ...import_crypto_js.default, ...global.Crypto };
38
54
  }
39
55
  }
40
56
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/browser/cryptoPolyfill.ts"],"sourcesContent":["import { Crypto } from './Crypto'\n\ntype WithOptionalCrypto = { Crypto?: typeof Crypto }\n\nconst isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nconst isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const cryptoPolyfill = () => {\n const global = isBrowser() ? (window as unknown as WithOptionalCrypto) : isWebworker() ? (self as unknown as WithOptionalCrypto) : undefined\n if (global) {\n if (global.Crypto === undefined) {\n global.Crypto = Crypto\n } else {\n global.Crypto = { ...Crypto, ...global.Crypto }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AAIvB,MAAM,YAAY,MAAM;AACtB,SAAO,OAAO,WAAW,eAAe,OAAO,QAAQ,aAAa;AACtE;AAEA,MAAM,cAAc,MAAM;AACxB,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,MAAM,iBAAiB,MAAM;AAClC,QAAM,SAAS,UAAU,IAAK,SAA2C,YAAY,IAAK,OAAyC;AACnI,MAAI,QAAQ;AACV,QAAI,OAAO,WAAW,QAAW;AAC/B,aAAO,SAAS;AAAA,IAClB,OAAO;AACL,aAAO,SAAS,EAAE,GAAG,sBAAQ,GAAG,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/browser/cryptoPolyfill.ts","../../src/browser/Crypto.ts"],"sourcesContent":["import { Crypto } from './Crypto'\n\ntype WithOptionalCrypto = { Crypto?: typeof Crypto }\n\nconst isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nconst isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const cryptoPolyfill = () => {\n const global = isBrowser() ? (window as unknown as WithOptionalCrypto) : isWebworker() ? (self as unknown as WithOptionalCrypto) : undefined\n if (global) {\n if (global.Crypto === undefined) {\n global.Crypto = Crypto\n } else {\n global.Crypto = { ...Crypto, ...global.Crypto }\n }\n }\n}\n","import Crypto from 'crypto-js'\n\nexport { Crypto }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,uBAAmB;;;ADInB,IAAM,YAAY,MAAM;AACtB,SAAO,OAAO,WAAW,eAAe,OAAO,QAAQ,aAAa;AACtE;AAEA,IAAM,cAAc,MAAM;AACxB,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,IAAM,iBAAiB,MAAM;AAClC,QAAM,SAAS,UAAU,IAAK,SAA2C,YAAY,IAAK,OAAyC;AACnI,MAAI,QAAQ;AACV,QAAI,OAAO,WAAW,QAAW;AAC/B,aAAO,SAAS,iBAAAA;AAAA,IAClB,OAAO;AACL,aAAO,SAAS,EAAE,GAAG,iBAAAA,SAAQ,GAAG,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;","names":["Crypto"]}
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
6
12
  var __copyProps = (to, from, except, desc) => {
7
13
  if (from && typeof from === "object" || typeof from === "function") {
8
14
  for (let key of __getOwnPropNames(from))
@@ -11,10 +17,42 @@ var __copyProps = (to, from, except, desc) => {
11
17
  }
12
18
  return to;
13
19
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
15
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/browser/index.ts
16
31
  var browser_exports = {};
32
+ __export(browser_exports, {
33
+ Crypto: () => import_crypto_js.default,
34
+ cryptoPolyfill: () => cryptoPolyfill
35
+ });
17
36
  module.exports = __toCommonJS(browser_exports);
18
- __reExport(browser_exports, require("./Crypto"), module.exports);
19
- __reExport(browser_exports, require("./cryptoPolyfill"), module.exports);
37
+
38
+ // src/browser/Crypto.ts
39
+ var import_crypto_js = __toESM(require("crypto-js"), 1);
40
+
41
+ // src/browser/cryptoPolyfill.ts
42
+ var isBrowser = () => {
43
+ return typeof window !== "undefined" && typeof window?.document !== "undefined";
44
+ };
45
+ var isWebworker = () => {
46
+ return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
47
+ };
48
+ var cryptoPolyfill = () => {
49
+ const global = isBrowser() ? window : isWebworker() ? self : void 0;
50
+ if (global) {
51
+ if (global.Crypto === void 0) {
52
+ global.Crypto = import_crypto_js.default;
53
+ } else {
54
+ global.Crypto = { ...import_crypto_js.default, ...global.Crypto };
55
+ }
56
+ }
57
+ };
20
58
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/browser/index.ts"],"sourcesContent":["export * from './Crypto'\nexport * from './cryptoPolyfill'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,qBAAd;AACA,4BAAc,6BADd;","names":[]}
1
+ {"version":3,"sources":["../../src/browser/index.ts","../../src/browser/Crypto.ts","../../src/browser/cryptoPolyfill.ts"],"sourcesContent":["export * from './Crypto'\nexport * from './cryptoPolyfill'\n","import Crypto from 'crypto-js'\n\nexport { Crypto }\n","import { Crypto } from './Crypto'\n\ntype WithOptionalCrypto = { Crypto?: typeof Crypto }\n\nconst isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nconst isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const cryptoPolyfill = () => {\n const global = isBrowser() ? (window as unknown as WithOptionalCrypto) : isWebworker() ? (self as unknown as WithOptionalCrypto) : undefined\n if (global) {\n if (global.Crypto === undefined) {\n global.Crypto = Crypto\n } else {\n global.Crypto = { ...Crypto, ...global.Crypto }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iCAAAA;AAAA,EAAA;AAAA;AAAA;;;ACAA,uBAAmB;;;ACInB,IAAM,YAAY,MAAM;AACtB,SAAO,OAAO,WAAW,eAAe,OAAO,QAAQ,aAAa;AACtE;AAEA,IAAM,cAAc,MAAM;AACxB,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,IAAM,iBAAiB,MAAM;AAClC,QAAM,SAAS,UAAU,IAAK,SAA2C,YAAY,IAAK,OAAyC;AACnI,MAAI,QAAQ;AACV,QAAI,OAAO,WAAW,QAAW;AAC/B,aAAO,SAAS,iBAAAC;AAAA,IAClB,OAAO;AACL,aAAO,SAAS,EAAE,GAAG,iBAAAA,SAAQ,GAAG,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;","names":["Crypto","Crypto"]}
@@ -0,0 +1,3 @@
1
+ import Crypto from 'crypto';
2
+ export { Crypto };
3
+ //# sourceMappingURL=Crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Crypto.d.ts","sourceRoot":"","sources":["../../../src/node/Crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const cryptoPolyfill: () => void;
2
+ //# sourceMappingURL=cryptoPolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cryptoPolyfill.d.ts","sourceRoot":"","sources":["../../../src/node/cryptoPolyfill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,YAE1B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './Crypto';
2
+ export * from './cryptoPolyfill';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import Crypto from 'crypto-js';
2
+ export { Crypto };
3
+ //# sourceMappingURL=Crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Crypto.d.ts","sourceRoot":"","sources":["../../../src/browser/Crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const cryptoPolyfill: () => void;
2
+ //# sourceMappingURL=cryptoPolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cryptoPolyfill.d.ts","sourceRoot":"","sources":["../../../src/browser/cryptoPolyfill.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,cAAc,YAS1B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './Crypto';
2
+ export * from './cryptoPolyfill';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import Crypto from 'crypto';
2
+ export { Crypto };
3
+ //# sourceMappingURL=Crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Crypto.d.ts","sourceRoot":"","sources":["../../../src/node/Crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const cryptoPolyfill: () => void;
2
+ //# sourceMappingURL=cryptoPolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cryptoPolyfill.d.ts","sourceRoot":"","sources":["../../../src/node/cryptoPolyfill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,YAE1B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './Crypto';
2
+ export * from './cryptoPolyfill';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA"}
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ".": {
17
17
  "browser": {
18
18
  "require": {
19
- "types": "./dist/browser/browser/index.d.ts",
19
+ "types": "./dist/browser/browser/index.d.cts",
20
20
  "default": "./dist/browser/index.cjs"
21
21
  },
22
22
  "import": {
@@ -25,7 +25,7 @@
25
25
  }
26
26
  },
27
27
  "require": {
28
- "types": "./dist/node/node/index.d.ts",
28
+ "types": "./dist/node/node/index.d.cts",
29
29
  "default": "./dist/node/index.cjs"
30
30
  },
31
31
  "import": {
@@ -55,9 +55,9 @@
55
55
  "devDependencies": {
56
56
  "@types/crypto-js": "^4.1.2",
57
57
  "@types/node": "^20.7.0",
58
- "@xylabs/ts-scripts-yarn3": "^3.0.74",
59
- "@xylabs/tsconfig": "^3.0.74",
60
- "@xylabs/tsconfig-dom": "^3.0.74",
58
+ "@xylabs/ts-scripts-yarn3": "^3.0.76",
59
+ "@xylabs/tsconfig": "^3.0.76",
60
+ "@xylabs/tsconfig-dom": "^3.0.76",
61
61
  "typescript": "^5.2.2"
62
62
  },
63
63
  "publishConfig": {
@@ -68,7 +68,7 @@
68
68
  "url": "https://github.com/xylabs/sdk-js.git"
69
69
  },
70
70
  "sideEffects": false,
71
- "version": "2.12.8",
71
+ "version": "2.12.10",
72
72
  "xy": {
73
73
  "compile": {
74
74
  "browser": {