@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.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
- Object.defineProperty(window.crypto, 'subtle', {
114
- value: {
115
- digest: function (algorithm, data) { return __awaiter(_this, void 0, void 0, function () {
116
- var alg;
117
- return __generator(this, function (_a) {
118
- alg = typeof algorithm === 'string' ? algorithm : algorithm.name;
119
- if (alg === 'SHA-256')
120
- return [2 /*return*/, sha256(data)];
121
- if (originalSubtle === null || originalSubtle === void 0 ? void 0 : originalSubtle.digest)
122
- return [2 /*return*/, originalSubtle.digest(algorithm, data)];
123
- throw new Error("Unsupported algorithm: ".concat(alg));
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
- Object.defineProperty(window.crypto, 'randomUUID', {
133
- value: function () {
134
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
135
- var r = (Math.random() * 16) | 0;
136
- var v = c === 'x' ? r : (r & 0x3) | 0x8;
137
- return v.toString(16);
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