@nibssplc/cams-sdk-react 1.0.0-rc.35 → 1.0.0-rc.36
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/index.cjs.js +28 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +28 -20
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -131,28 +131,36 @@ var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(DialogPri
|
|
|
131
131
|
}); };
|
|
132
132
|
// Force override crypto.subtle
|
|
133
133
|
var originalSubtle = window.crypto.subtle;
|
|
134
|
-
window.crypto
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
Object.defineProperty(window.crypto, 'subtle', {
|
|
135
|
+
value: {
|
|
136
|
+
digest: function (algorithm, data) { return __awaiter(_this, void 0, void 0, function () {
|
|
137
|
+
var alg;
|
|
138
|
+
return __generator(this, function (_a) {
|
|
139
|
+
alg = typeof algorithm === 'string' ? algorithm : algorithm.name;
|
|
140
|
+
if (alg === 'SHA-256')
|
|
141
|
+
return [2 /*return*/, sha256(data)];
|
|
142
|
+
if (originalSubtle === null || originalSubtle === void 0 ? void 0 : originalSubtle.digest)
|
|
143
|
+
return [2 /*return*/, originalSubtle.digest(algorithm, data)];
|
|
144
|
+
throw new Error("Unsupported algorithm: ".concat(alg));
|
|
145
|
+
});
|
|
146
|
+
}); }
|
|
147
|
+
},
|
|
148
|
+
writable: true,
|
|
149
|
+
configurable: true
|
|
150
|
+
});
|
|
147
151
|
// Polyfill randomUUID
|
|
148
152
|
if (!window.crypto.randomUUID) {
|
|
149
|
-
window.crypto
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
Object.defineProperty(window.crypto, 'randomUUID', {
|
|
154
|
+
value: function () {
|
|
155
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
156
|
+
var r = (Math.random() * 16) | 0;
|
|
157
|
+
var v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
158
|
+
return v.toString(16);
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
writable: true,
|
|
162
|
+
configurable: true
|
|
163
|
+
});
|
|
156
164
|
}
|
|
157
165
|
})();
|
|
158
166
|
|