@nibssplc/cams-sdk-react 1.0.0-rc.36 → 1.0.0-rc.37
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 +20 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +20 -28
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -110,36 +110,28 @@ import https from 'https';
|
|
|
110
110
|
}); };
|
|
111
111
|
// Force override crypto.subtle
|
|
112
112
|
var originalSubtle = window.crypto.subtle;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
writable: true,
|
|
128
|
-
configurable: true
|
|
129
|
-
});
|
|
113
|
+
window.crypto.subtle = {
|
|
114
|
+
digest: function (algorithm, data) { return __awaiter(_this, void 0, void 0, function () {
|
|
115
|
+
var alg;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
alg = typeof algorithm === 'string' ? algorithm : algorithm.name;
|
|
118
|
+
if (alg === 'SHA-256')
|
|
119
|
+
return [2 /*return*/, sha256(data)];
|
|
120
|
+
if (originalSubtle === null || originalSubtle === void 0 ? void 0 : originalSubtle.digest)
|
|
121
|
+
return [2 /*return*/, originalSubtle.digest(algorithm, data)];
|
|
122
|
+
throw new Error("Unsupported algorithm: ".concat(alg));
|
|
123
|
+
});
|
|
124
|
+
}); }
|
|
125
|
+
};
|
|
130
126
|
// Polyfill randomUUID
|
|
131
127
|
if (!window.crypto.randomUUID) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
writable: true,
|
|
141
|
-
configurable: true
|
|
142
|
-
});
|
|
128
|
+
window.crypto.randomUUID = function () {
|
|
129
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
130
|
+
var r = (Math.random() * 16) | 0;
|
|
131
|
+
var v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
132
|
+
return v.toString(16);
|
|
133
|
+
});
|
|
134
|
+
};
|
|
143
135
|
}
|
|
144
136
|
})();
|
|
145
137
|
|