@xylabs/crypto 2.12.9 → 2.12.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/Crypto.cjs
CHANGED
|
@@ -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":"
|
|
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,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
|
-
|
|
25
|
-
|
|
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
|
-
|
|
44
|
+
var isWebworker = () => {
|
|
29
45
|
return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
30
46
|
};
|
|
31
|
-
|
|
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 =
|
|
51
|
+
global.Crypto = import_crypto_js.default;
|
|
36
52
|
} else {
|
|
37
|
-
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":"
|
|
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"]}
|
package/dist/browser/index.cjs
CHANGED
|
@@ -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
|
|
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
|
-
|
|
19
|
-
|
|
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":"
|
|
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"]}
|
package/package.json
CHANGED
|
@@ -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.
|
|
59
|
-
"@xylabs/tsconfig": "^3.0.
|
|
60
|
-
"@xylabs/tsconfig-dom": "^3.0.
|
|
58
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.78",
|
|
59
|
+
"@xylabs/tsconfig": "^3.0.78",
|
|
60
|
+
"@xylabs/tsconfig-dom": "^3.0.78",
|
|
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.
|
|
71
|
+
"version": "2.12.11",
|
|
72
72
|
"xy": {
|
|
73
73
|
"compile": {
|
|
74
74
|
"browser": {
|