@xylabs/crypto 2.12.12 → 2.12.14
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.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/browser/Crypto.ts"],"sourcesContent":["import Crypto from 'crypto-js'\n\nexport { Crypto }\n"],"mappings":"AAAA,OAAO,YAAY;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/browser/Crypto.ts"],"sourcesContent":["import Crypto from 'crypto-js'\n\nexport { Crypto }\n"],"mappings":";AAAA,OAAO,YAAY;","names":[]}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/browser/Crypto.ts
|
|
2
|
+
import Crypto from "crypto-js";
|
|
3
|
+
|
|
4
|
+
// src/browser/cryptoPolyfill.ts
|
|
5
|
+
var isBrowser = () => {
|
|
3
6
|
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
4
7
|
};
|
|
5
|
-
|
|
8
|
+
var isWebworker = () => {
|
|
6
9
|
return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
7
10
|
};
|
|
8
|
-
|
|
11
|
+
var cryptoPolyfill = () => {
|
|
9
12
|
const global = isBrowser() ? window : isWebworker() ? self : void 0;
|
|
10
13
|
if (global) {
|
|
11
14
|
if (global.Crypto === void 0) {
|
|
@@ -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,
|
|
1
|
+
{"version":3,"sources":["../../src/browser/Crypto.ts","../../src/browser/cryptoPolyfill.ts"],"sourcesContent":["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,OAAO,YAAY;;;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;AAAA,IAClB,OAAO;AACL,aAAO,SAAS,EAAE,GAAG,QAAQ,GAAG,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;","names":[]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/browser/Crypto.ts
|
|
2
|
+
import Crypto from "crypto-js";
|
|
3
|
+
|
|
4
|
+
// src/browser/cryptoPolyfill.ts
|
|
5
|
+
var isBrowser = () => {
|
|
6
|
+
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
7
|
+
};
|
|
8
|
+
var isWebworker = () => {
|
|
9
|
+
return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
10
|
+
};
|
|
11
|
+
var cryptoPolyfill = () => {
|
|
12
|
+
const global = isBrowser() ? window : isWebworker() ? self : void 0;
|
|
13
|
+
if (global) {
|
|
14
|
+
if (global.Crypto === void 0) {
|
|
15
|
+
global.Crypto = Crypto;
|
|
16
|
+
} else {
|
|
17
|
+
global.Crypto = { ...Crypto, ...global.Crypto };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
Crypto,
|
|
23
|
+
cryptoPolyfill
|
|
24
|
+
};
|
|
3
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/browser/
|
|
1
|
+
{"version":3,"sources":["../../src/browser/Crypto.ts","../../src/browser/cryptoPolyfill.ts"],"sourcesContent":["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,OAAO,YAAY;;;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;AAAA,IAClB,OAAO;AACL,aAAO,SAAS,EAAE,GAAG,QAAQ,GAAG,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/crypto-js": "^4.1.2",
|
|
57
|
-
"@types/node": "^20.7.
|
|
58
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
59
|
-
"@xylabs/tsconfig": "^3.0.
|
|
60
|
-
"@xylabs/tsconfig-dom": "^3.0.
|
|
57
|
+
"@types/node": "^20.7.1",
|
|
58
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.79",
|
|
59
|
+
"@xylabs/tsconfig": "^3.0.79",
|
|
60
|
+
"@xylabs/tsconfig-dom": "^3.0.79",
|
|
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.14",
|
|
72
72
|
"xy": {
|
|
73
73
|
"compile": {
|
|
74
74
|
"browser": {
|