@metamask/utils 8.2.0 → 8.2.1
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/CHANGELOG.md +6 -1
- package/dist/assert.js +3 -3
- package/dist/assert.mjs +2 -2
- package/dist/base64.js +4 -4
- package/dist/base64.mjs +3 -3
- package/dist/bytes.js +4 -4
- package/dist/bytes.mjs +3 -3
- package/dist/checksum.js +5 -5
- package/dist/checksum.mjs +4 -4
- package/dist/{chunk-ZRNIY7OW.js → chunk-4D6XQBHA.js} +4 -4
- package/dist/{chunk-VL5DYXC5.mjs → chunk-52OU772R.mjs} +2 -2
- package/dist/{chunk-65KBH4FZ.mjs → chunk-6C35XQOF.mjs} +2 -2
- package/dist/{chunk-WRBN6DWM.js → chunk-6NZW4WK4.js} +3 -3
- package/dist/{chunk-VBYRLAP6.js → chunk-6ZDHSOUV.js} +3 -3
- package/dist/{chunk-CSDMTDND.mjs → chunk-74DGVJVE.mjs} +2 -2
- package/dist/{chunk-WQDTPIQK.js → chunk-BFQDMI3M.js} +12 -12
- package/dist/{chunk-JCYFTGED.js → chunk-DHVKFDHQ.js} +9 -9
- package/dist/{chunk-XYYGZF5Y.js → chunk-E4C7EW4R.js} +3 -3
- package/dist/{chunk-N53OILN6.mjs → chunk-GZS3IQBZ.mjs} +2 -2
- package/dist/{chunk-DMPG3H3G.js → chunk-IZC266HS.js} +7 -13
- package/dist/chunk-IZC266HS.js.map +1 -0
- package/dist/{chunk-HLDWS2JR.mjs → chunk-NQMRFZHB.mjs} +2 -2
- package/dist/{chunk-2CY4F77D.mjs → chunk-O3EIM33O.mjs} +3 -3
- package/dist/{chunk-5WQRFJVQ.js → chunk-OLLG4H35.js} +11 -11
- package/dist/{chunk-YQJBIHC7.js → chunk-QEPVHEP7.js} +20 -20
- package/dist/{chunk-G66TREC6.mjs → chunk-ROQSKDP5.mjs} +2 -2
- package/dist/{chunk-VSEW3V2L.mjs → chunk-S3UHBN2Z.mjs} +3 -3
- package/dist/{chunk-BKR45GQY.mjs → chunk-VA2DRBDE.mjs} +2 -2
- package/dist/chunk-VFXTVNXN.js +44 -0
- package/dist/{chunk-7S5AWFX7.mjs → chunk-XYGUOY6N.mjs} +7 -13
- package/dist/{chunk-7S5AWFX7.mjs.map → chunk-XYGUOY6N.mjs.map} +1 -1
- package/dist/coercers.js +5 -5
- package/dist/coercers.mjs +4 -4
- package/dist/errors.js +2 -2
- package/dist/errors.mjs +1 -1
- package/dist/fs.js +3 -3
- package/dist/fs.mjs +2 -2
- package/dist/hex.js +4 -4
- package/dist/hex.mjs +3 -3
- package/dist/index.js +10 -10
- package/dist/index.mjs +9 -9
- package/dist/json.js +4 -4
- package/dist/json.mjs +3 -3
- package/dist/node.js +11 -11
- package/dist/node.mjs +10 -10
- package/dist/number.js +5 -5
- package/dist/number.mjs +4 -4
- package/dist/versions.js +4 -4
- package/dist/versions.mjs +3 -3
- package/package.json +2 -2
- package/dist/chunk-4JNG5UTO.js +0 -44
- package/dist/chunk-DMPG3H3G.js.map +0 -1
- /package/dist/{chunk-ZRNIY7OW.js.map → chunk-4D6XQBHA.js.map} +0 -0
- /package/dist/{chunk-VL5DYXC5.mjs.map → chunk-52OU772R.mjs.map} +0 -0
- /package/dist/{chunk-65KBH4FZ.mjs.map → chunk-6C35XQOF.mjs.map} +0 -0
- /package/dist/{chunk-WRBN6DWM.js.map → chunk-6NZW4WK4.js.map} +0 -0
- /package/dist/{chunk-VBYRLAP6.js.map → chunk-6ZDHSOUV.js.map} +0 -0
- /package/dist/{chunk-CSDMTDND.mjs.map → chunk-74DGVJVE.mjs.map} +0 -0
- /package/dist/{chunk-WQDTPIQK.js.map → chunk-BFQDMI3M.js.map} +0 -0
- /package/dist/{chunk-JCYFTGED.js.map → chunk-DHVKFDHQ.js.map} +0 -0
- /package/dist/{chunk-XYYGZF5Y.js.map → chunk-E4C7EW4R.js.map} +0 -0
- /package/dist/{chunk-N53OILN6.mjs.map → chunk-GZS3IQBZ.mjs.map} +0 -0
- /package/dist/{chunk-HLDWS2JR.mjs.map → chunk-NQMRFZHB.mjs.map} +0 -0
- /package/dist/{chunk-2CY4F77D.mjs.map → chunk-O3EIM33O.mjs.map} +0 -0
- /package/dist/{chunk-5WQRFJVQ.js.map → chunk-OLLG4H35.js.map} +0 -0
- /package/dist/{chunk-YQJBIHC7.js.map → chunk-QEPVHEP7.js.map} +0 -0
- /package/dist/{chunk-G66TREC6.mjs.map → chunk-ROQSKDP5.mjs.map} +0 -0
- /package/dist/{chunk-VSEW3V2L.mjs.map → chunk-S3UHBN2Z.mjs.map} +0 -0
- /package/dist/{chunk-BKR45GQY.mjs.map → chunk-VA2DRBDE.mjs.map} +0 -0
- /package/dist/{chunk-4JNG5UTO.js.map → chunk-VFXTVNXN.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [8.2.1]
|
|
10
|
+
### Fixed
|
|
11
|
+
- Fix issue with source maps where line numbers were incorrect for src/error.ts ([#156](https://github.com/MetaMask/utils/pull/156))
|
|
12
|
+
|
|
9
13
|
## [8.2.0]
|
|
10
14
|
### Added
|
|
11
15
|
- Add struct utils for validating JSON objects with optional values ([#136](https://github.com/MetaMask/utils/pull/136))
|
|
@@ -204,7 +208,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
204
208
|
### Added
|
|
205
209
|
- Initial release
|
|
206
210
|
|
|
207
|
-
[Unreleased]: https://github.com/MetaMask/utils/compare/v8.2.
|
|
211
|
+
[Unreleased]: https://github.com/MetaMask/utils/compare/v8.2.1...HEAD
|
|
212
|
+
[8.2.1]: https://github.com/MetaMask/utils/compare/v8.2.0...v8.2.1
|
|
208
213
|
[8.2.0]: https://github.com/MetaMask/utils/compare/v8.1.0...v8.2.0
|
|
209
214
|
[8.1.0]: https://github.com/MetaMask/utils/compare/v8.0.0...v8.1.0
|
|
210
215
|
[8.0.0]: https://github.com/MetaMask/utils/compare/v7.1.0...v8.0.0
|
package/dist/assert.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
7
|
+
require('./chunk-IZC266HS.js');
|
|
8
8
|
require('./chunk-QVEKZRZ2.js');
|
|
9
9
|
require('./chunk-3W5G4CYI.js');
|
|
10
10
|
|
|
@@ -12,5 +12,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
exports.AssertionError =
|
|
15
|
+
exports.AssertionError = _chunk6ZDHSOUVjs.AssertionError; exports.assert = _chunk6ZDHSOUVjs.assert; exports.assertExhaustive = _chunk6ZDHSOUVjs.assertExhaustive; exports.assertStruct = _chunk6ZDHSOUVjs.assertStruct;
|
|
16
16
|
//# sourceMappingURL=assert.js.map
|
package/dist/assert.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
assert,
|
|
4
4
|
assertExhaustive,
|
|
5
5
|
assertStruct
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
7
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
8
8
|
import "./chunk-H4YFDLB7.mjs";
|
|
9
9
|
import "./chunk-X66SUIEF.mjs";
|
|
10
10
|
export {
|
package/dist/base64.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunk6NZW4WK4js = require('./chunk-6NZW4WK4.js');
|
|
4
|
+
require('./chunk-6ZDHSOUV.js');
|
|
5
|
+
require('./chunk-IZC266HS.js');
|
|
6
6
|
require('./chunk-QVEKZRZ2.js');
|
|
7
7
|
require('./chunk-3W5G4CYI.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.base64 =
|
|
10
|
+
exports.base64 = _chunk6NZW4WK4js.base64;
|
|
11
11
|
//# sourceMappingURL=base64.js.map
|
package/dist/base64.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
base64
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-NQMRFZHB.mjs";
|
|
4
|
+
import "./chunk-74DGVJVE.mjs";
|
|
5
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
6
6
|
import "./chunk-H4YFDLB7.mjs";
|
|
7
7
|
import "./chunk-X66SUIEF.mjs";
|
|
8
8
|
export {
|
package/dist/bytes.js
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
20
|
-
require('./chunk-
|
|
21
|
-
require('./chunk-
|
|
19
|
+
var _chunkQEPVHEP7js = require('./chunk-QEPVHEP7.js');
|
|
20
|
+
require('./chunk-6ZDHSOUV.js');
|
|
21
|
+
require('./chunk-IZC266HS.js');
|
|
22
22
|
require('./chunk-QVEKZRZ2.js');
|
|
23
23
|
require('./chunk-3W5G4CYI.js');
|
|
24
24
|
|
|
@@ -39,5 +39,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.assertIsBytes =
|
|
42
|
+
exports.assertIsBytes = _chunkQEPVHEP7js.assertIsBytes; exports.base64ToBytes = _chunkQEPVHEP7js.base64ToBytes; exports.bigIntToBytes = _chunkQEPVHEP7js.bigIntToBytes; exports.bytesToBase64 = _chunkQEPVHEP7js.bytesToBase64; exports.bytesToBigInt = _chunkQEPVHEP7js.bytesToBigInt; exports.bytesToHex = _chunkQEPVHEP7js.bytesToHex; exports.bytesToNumber = _chunkQEPVHEP7js.bytesToNumber; exports.bytesToSignedBigInt = _chunkQEPVHEP7js.bytesToSignedBigInt; exports.bytesToString = _chunkQEPVHEP7js.bytesToString; exports.concatBytes = _chunkQEPVHEP7js.concatBytes; exports.createDataView = _chunkQEPVHEP7js.createDataView; exports.hexToBytes = _chunkQEPVHEP7js.hexToBytes; exports.isBytes = _chunkQEPVHEP7js.isBytes; exports.numberToBytes = _chunkQEPVHEP7js.numberToBytes; exports.signedBigIntToBytes = _chunkQEPVHEP7js.signedBigIntToBytes; exports.stringToBytes = _chunkQEPVHEP7js.stringToBytes; exports.valueToBytes = _chunkQEPVHEP7js.valueToBytes;
|
|
43
43
|
//# sourceMappingURL=bytes.js.map
|
package/dist/bytes.mjs
CHANGED
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
signedBigIntToBytes,
|
|
17
17
|
stringToBytes,
|
|
18
18
|
valueToBytes
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-VA2DRBDE.mjs";
|
|
20
|
+
import "./chunk-74DGVJVE.mjs";
|
|
21
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
22
22
|
import "./chunk-H4YFDLB7.mjs";
|
|
23
23
|
import "./chunk-X66SUIEF.mjs";
|
|
24
24
|
export {
|
package/dist/checksum.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkE4C7EW4Rjs = require('./chunk-E4C7EW4R.js');
|
|
4
|
+
require('./chunk-6NZW4WK4.js');
|
|
5
|
+
require('./chunk-6ZDHSOUV.js');
|
|
6
|
+
require('./chunk-IZC266HS.js');
|
|
7
7
|
require('./chunk-QVEKZRZ2.js');
|
|
8
8
|
require('./chunk-3W5G4CYI.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.ChecksumStruct =
|
|
11
|
+
exports.ChecksumStruct = _chunkE4C7EW4Rjs.ChecksumStruct;
|
|
12
12
|
//# sourceMappingURL=checksum.js.map
|
package/dist/checksum.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChecksumStruct
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-GZS3IQBZ.mjs";
|
|
4
|
+
import "./chunk-NQMRFZHB.mjs";
|
|
5
|
+
import "./chunk-74DGVJVE.mjs";
|
|
6
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
7
7
|
import "./chunk-H4YFDLB7.mjs";
|
|
8
8
|
import "./chunk-X66SUIEF.mjs";
|
|
9
9
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
4
4
|
|
|
5
5
|
// src/versions.ts
|
|
6
6
|
|
|
@@ -38,10 +38,10 @@ function isValidSemVerRange(versionRange) {
|
|
|
38
38
|
return _superstruct.is.call(void 0, versionRange, VersionRangeStruct);
|
|
39
39
|
}
|
|
40
40
|
function assertIsSemVerVersion(version) {
|
|
41
|
-
|
|
41
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0, version, VersionStruct);
|
|
42
42
|
}
|
|
43
43
|
function assertIsSemVerRange(range) {
|
|
44
|
-
|
|
44
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0, range, VersionRangeStruct);
|
|
45
45
|
}
|
|
46
46
|
function gtVersion(version1, version2) {
|
|
47
47
|
return _semver.gt.call(void 0, version1, version2);
|
|
@@ -66,4 +66,4 @@ function satisfiesVersionRange(version, versionRange) {
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
exports.VersionStruct = VersionStruct; exports.VersionRangeStruct = VersionRangeStruct; exports.isValidSemVerVersion = isValidSemVerVersion; exports.isValidSemVerRange = isValidSemVerRange; exports.assertIsSemVerVersion = assertIsSemVerVersion; exports.assertIsSemVerRange = assertIsSemVerRange; exports.gtVersion = gtVersion; exports.gtRange = gtRange; exports.satisfiesVersionRange = satisfiesVersionRange;
|
|
69
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-4D6XQBHA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isErrorWithCode,
|
|
3
3
|
wrapError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XYGUOY6N.mjs";
|
|
5
5
|
|
|
6
6
|
// src/fs.ts
|
|
7
7
|
import fs from "fs";
|
|
@@ -119,4 +119,4 @@ export {
|
|
|
119
119
|
forceRemove,
|
|
120
120
|
createSandbox
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-52OU772R.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertStruct
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
4
4
|
import {
|
|
5
5
|
hasProperty
|
|
6
6
|
} from "./chunk-H4YFDLB7.mjs";
|
|
@@ -254,4 +254,4 @@ export {
|
|
|
254
254
|
assertIsJsonRpcError,
|
|
255
255
|
getJsonRpcIdValidator
|
|
256
256
|
};
|
|
257
|
-
//# sourceMappingURL=chunk-
|
|
257
|
+
//# sourceMappingURL=chunk-6C35XQOF.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
4
4
|
|
|
5
5
|
// src/base64.ts
|
|
6
6
|
var _superstruct = require('superstruct');
|
|
@@ -11,7 +11,7 @@ var base64 = (struct, options = {}) => {
|
|
|
11
11
|
if (characterSet === "base64") {
|
|
12
12
|
letters = String.raw`[A-Za-z0-9+\/]`;
|
|
13
13
|
} else {
|
|
14
|
-
|
|
14
|
+
_chunk6ZDHSOUVjs.assert.call(void 0, characterSet === "base64url");
|
|
15
15
|
letters = String.raw`[-_A-Za-z0-9]`;
|
|
16
16
|
}
|
|
17
17
|
let re;
|
|
@@ -32,4 +32,4 @@ var base64 = (struct, options = {}) => {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
exports.base64 = base64;
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-6NZW4WK4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIZC266HSjs = require('./chunk-IZC266HS.js');
|
|
4
4
|
|
|
5
5
|
// src/assert.ts
|
|
6
6
|
var _superstruct = require('superstruct');
|
|
@@ -8,7 +8,7 @@ function isConstructable(fn) {
|
|
|
8
8
|
return Boolean(typeof _optionalChain([fn, 'optionalAccess', _ => _.prototype, 'optionalAccess', _2 => _2.constructor, 'optionalAccess', _3 => _3.name]) === "string");
|
|
9
9
|
}
|
|
10
10
|
function getErrorMessageWithoutTrailingPeriod(error) {
|
|
11
|
-
return
|
|
11
|
+
return _chunkIZC266HSjs.getErrorMessage.call(void 0, error).replace(/\.$/u, "");
|
|
12
12
|
}
|
|
13
13
|
function getError(ErrorWrapper, message) {
|
|
14
14
|
if (isConstructable(ErrorWrapper)) {
|
|
@@ -56,4 +56,4 @@ function assertExhaustive(_object) {
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
exports.AssertionError = AssertionError; exports.assert = assert; exports.assertStruct = assertStruct; exports.assertExhaustive = assertExhaustive;
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-6ZDHSOUV.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getErrorMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XYGUOY6N.mjs";
|
|
4
4
|
|
|
5
5
|
// src/assert.ts
|
|
6
6
|
import { assert as assertSuperstruct } from "superstruct";
|
|
@@ -56,4 +56,4 @@ export {
|
|
|
56
56
|
assertStruct,
|
|
57
57
|
assertExhaustive
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-74DGVJVE.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkIZC266HSjs = require('./chunk-IZC266HS.js');
|
|
5
5
|
|
|
6
6
|
// src/fs.ts
|
|
7
7
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -11,7 +11,7 @@ async function readFile(filePath) {
|
|
|
11
11
|
try {
|
|
12
12
|
return await _fs2.default.promises.readFile(filePath, "utf8");
|
|
13
13
|
} catch (error) {
|
|
14
|
-
throw
|
|
14
|
+
throw _chunkIZC266HSjs.wrapError.call(void 0, error, `Could not read file '${filePath}'`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
async function writeFile(filePath, content) {
|
|
@@ -19,7 +19,7 @@ async function writeFile(filePath, content) {
|
|
|
19
19
|
await _fs2.default.promises.mkdir(_path2.default.dirname(filePath), { recursive: true });
|
|
20
20
|
await _fs2.default.promises.writeFile(filePath, content);
|
|
21
21
|
} catch (error) {
|
|
22
|
-
throw
|
|
22
|
+
throw _chunkIZC266HSjs.wrapError.call(void 0, error, `Could not write file '${filePath}'`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
async function readJsonFile(filePath, {
|
|
@@ -29,7 +29,7 @@ async function readJsonFile(filePath, {
|
|
|
29
29
|
const content = await _fs2.default.promises.readFile(filePath, "utf8");
|
|
30
30
|
return parser.parse(content);
|
|
31
31
|
} catch (error) {
|
|
32
|
-
throw
|
|
32
|
+
throw _chunkIZC266HSjs.wrapError.call(void 0, error, `Could not read JSON file '${filePath}'`);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
async function writeJsonFile(filePath, jsonValue, {
|
|
@@ -41,7 +41,7 @@ async function writeJsonFile(filePath, jsonValue, {
|
|
|
41
41
|
const json = prettify ? stringifier.stringify(jsonValue, null, " ") : stringifier.stringify(jsonValue);
|
|
42
42
|
await _fs2.default.promises.writeFile(filePath, json);
|
|
43
43
|
} catch (error) {
|
|
44
|
-
throw
|
|
44
|
+
throw _chunkIZC266HSjs.wrapError.call(void 0, error, `Could not write JSON file '${filePath}'`);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
async function fileExists(filePath) {
|
|
@@ -49,10 +49,10 @@ async function fileExists(filePath) {
|
|
|
49
49
|
const stats = await _fs2.default.promises.stat(filePath);
|
|
50
50
|
return stats.isFile();
|
|
51
51
|
} catch (error) {
|
|
52
|
-
if (
|
|
52
|
+
if (_chunkIZC266HSjs.isErrorWithCode.call(void 0, error) && error.code === "ENOENT") {
|
|
53
53
|
return false;
|
|
54
54
|
}
|
|
55
|
-
throw
|
|
55
|
+
throw _chunkIZC266HSjs.wrapError.call(void 0, error, `Could not determine if file exists '${filePath}'`);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
async function directoryExists(directoryPath) {
|
|
@@ -60,10 +60,10 @@ async function directoryExists(directoryPath) {
|
|
|
60
60
|
const stats = await _fs2.default.promises.stat(directoryPath);
|
|
61
61
|
return stats.isDirectory();
|
|
62
62
|
} catch (error) {
|
|
63
|
-
if (
|
|
63
|
+
if (_chunkIZC266HSjs.isErrorWithCode.call(void 0, error) && error.code === "ENOENT") {
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
|
-
throw
|
|
66
|
+
throw _chunkIZC266HSjs.wrapError.call(void 0,
|
|
67
67
|
error,
|
|
68
68
|
`Could not determine if directory exists '${directoryPath}'`
|
|
69
69
|
);
|
|
@@ -73,7 +73,7 @@ async function ensureDirectoryStructureExists(directoryPath) {
|
|
|
73
73
|
try {
|
|
74
74
|
await _fs2.default.promises.mkdir(directoryPath, { recursive: true });
|
|
75
75
|
} catch (error) {
|
|
76
|
-
throw
|
|
76
|
+
throw _chunkIZC266HSjs.wrapError.call(void 0,
|
|
77
77
|
error,
|
|
78
78
|
`Could not create directory structure '${directoryPath}'`
|
|
79
79
|
);
|
|
@@ -86,7 +86,7 @@ async function forceRemove(entryPath) {
|
|
|
86
86
|
force: true
|
|
87
87
|
});
|
|
88
88
|
} catch (error) {
|
|
89
|
-
throw
|
|
89
|
+
throw _chunkIZC266HSjs.wrapError.call(void 0, error, `Could not remove file or directory '${entryPath}'`);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
function createSandbox(projectName) {
|
|
@@ -119,4 +119,4 @@ function createSandbox(projectName) {
|
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
exports.readFile = readFile; exports.writeFile = writeFile; exports.readJsonFile = readJsonFile; exports.writeJsonFile = writeJsonFile; exports.fileExists = fileExists; exports.directoryExists = directoryExists; exports.ensureDirectoryStructureExists = ensureDirectoryStructureExists; exports.forceRemove = forceRemove; exports.createSandbox = createSandbox;
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-BFQDMI3M.js.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkQEPVHEP7js = require('./chunk-QEPVHEP7.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
9
9
|
|
|
10
10
|
// src/coercers.ts
|
|
11
11
|
|
|
@@ -18,20 +18,20 @@ var _chunkVBYRLAP6js = require('./chunk-VBYRLAP6.js');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _superstruct = require('superstruct');
|
|
21
|
-
var NumberLikeStruct = _superstruct.union.call(void 0, [_superstruct.number.call(void 0, ), _superstruct.bigint.call(void 0, ), _superstruct.string.call(void 0, ),
|
|
21
|
+
var NumberLikeStruct = _superstruct.union.call(void 0, [_superstruct.number.call(void 0, ), _superstruct.bigint.call(void 0, ), _superstruct.string.call(void 0, ), _chunkQEPVHEP7js.StrictHexStruct]);
|
|
22
22
|
var NumberCoercer = _superstruct.coerce.call(void 0, _superstruct.number.call(void 0, ), NumberLikeStruct, Number);
|
|
23
23
|
var BigIntCoercer = _superstruct.coerce.call(void 0, _superstruct.bigint.call(void 0, ), NumberLikeStruct, BigInt);
|
|
24
|
-
var BytesLikeStruct = _superstruct.union.call(void 0, [
|
|
24
|
+
var BytesLikeStruct = _superstruct.union.call(void 0, [_chunkQEPVHEP7js.StrictHexStruct, _superstruct.instance.call(void 0, Uint8Array)]);
|
|
25
25
|
var BytesCoercer = _superstruct.coerce.call(void 0,
|
|
26
26
|
_superstruct.instance.call(void 0, Uint8Array),
|
|
27
|
-
_superstruct.union.call(void 0, [
|
|
28
|
-
|
|
27
|
+
_superstruct.union.call(void 0, [_chunkQEPVHEP7js.StrictHexStruct]),
|
|
28
|
+
_chunkQEPVHEP7js.hexToBytes
|
|
29
29
|
);
|
|
30
|
-
var HexCoercer = _superstruct.coerce.call(void 0,
|
|
30
|
+
var HexCoercer = _superstruct.coerce.call(void 0, _chunkQEPVHEP7js.StrictHexStruct, _superstruct.instance.call(void 0, Uint8Array), _chunkQEPVHEP7js.bytesToHex);
|
|
31
31
|
function createNumber(value) {
|
|
32
32
|
try {
|
|
33
33
|
const result = _superstruct.create.call(void 0, value, NumberCoercer);
|
|
34
|
-
|
|
34
|
+
_chunk6ZDHSOUVjs.assert.call(void 0,
|
|
35
35
|
Number.isFinite(result),
|
|
36
36
|
`Expected a number-like value, got "${value}".`
|
|
37
37
|
);
|
|
@@ -92,4 +92,4 @@ function createHex(value) {
|
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
exports.createNumber = createNumber; exports.createBigInt = createBigInt; exports.createBytes = createBytes; exports.createHex = createHex;
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-DHVKFDHQ.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6NZW4WK4js = require('./chunk-6NZW4WK4.js');
|
|
4
4
|
|
|
5
5
|
// src/checksum.ts
|
|
6
6
|
var _superstruct = require('superstruct');
|
|
7
7
|
var ChecksumStruct = _superstruct.size.call(void 0,
|
|
8
|
-
|
|
8
|
+
_chunk6NZW4WK4js.base64.call(void 0, _superstruct.string.call(void 0, ), { paddingRequired: true }),
|
|
9
9
|
44,
|
|
10
10
|
44
|
|
11
11
|
);
|
|
@@ -13,4 +13,4 @@ var ChecksumStruct = _superstruct.size.call(void 0,
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
exports.ChecksumStruct = ChecksumStruct;
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-E4C7EW4R.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
base64
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NQMRFZHB.mjs";
|
|
4
4
|
|
|
5
5
|
// src/checksum.ts
|
|
6
6
|
import { size, string } from "superstruct";
|
|
@@ -13,4 +13,4 @@ var ChecksumStruct = size(
|
|
|
13
13
|
export {
|
|
14
14
|
ChecksumStruct
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-GZS3IQBZ.mjs.map
|
|
@@ -28,18 +28,12 @@ function getErrorMessage(error) {
|
|
|
28
28
|
}
|
|
29
29
|
function wrapError(originalError, message) {
|
|
30
30
|
if (isError(originalError)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// but `tsc` does. I'm not sure why, but we disable this in the
|
|
38
|
-
// meantime.
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
new Error(message, { cause: originalError })
|
|
42
|
-
) : new (0, _ponycause.ErrorWithCause)(message, { cause: originalError });
|
|
31
|
+
let error;
|
|
32
|
+
if (Error.length === 2) {
|
|
33
|
+
error = new Error(message, { cause: originalError });
|
|
34
|
+
} else {
|
|
35
|
+
error = new (0, _ponycause.ErrorWithCause)(message, { cause: originalError });
|
|
36
|
+
}
|
|
43
37
|
if (isErrorWithCode(originalError)) {
|
|
44
38
|
error.code = originalError.code;
|
|
45
39
|
}
|
|
@@ -58,4 +52,4 @@ function wrapError(originalError, message) {
|
|
|
58
52
|
|
|
59
53
|
|
|
60
54
|
exports.isErrorWithCode = isErrorWithCode; exports.isErrorWithMessage = isErrorWithMessage; exports.isErrorWithStack = isErrorWithStack; exports.getErrorMessage = getErrorMessage; exports.wrapError = wrapError;
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-IZC266HS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"names":[],"mappings":";;;;;;AAAA,SAAS,sBAAsB;AAY/B,SAAS,QAAQ,OAAgC;AAC/C,SACE,iBAAiB,SAChB,SAAS,KAAK,KAAK,MAAM,YAAY,SAAS;AAEnD;AAUO,SAAS,gBAAgB,OAA2C;AACzE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AAClE;AASO,SAAS,mBACd,OAC8B;AAC9B,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa;AACrE;AASO,SAAS,iBAAiB,OAA4C;AAC3E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,WAAW;AACnE;AAWO,SAAS,gBAAgB,OAAwB;AACtD,MAAI,mBAAmB,KAAK,KAAK,OAAO,MAAM,YAAY,UAAU;AAClE,WAAO,MAAM;AAAA,EACf;AAEA,MAAI,kBAAkB,KAAK,GAAG;AAC5B,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,KAAK;AACrB;AAeO,SAAS,UACd,eACA,SAC2B;AAC3B,MAAI,QAAQ,aAAa,GAAG;AAC1B,QAAI;AACJ,QAAI,MAAM,WAAW,GAAG;AAMtB,cAAQ,IAAI,MAAM,SAAS,EAAE,OAAO,cAAc,CAAC;AAAA,IACrD,OAAO;AAGL,cAAQ,IAAI,eAAe,SAAS,EAAE,OAAO,cAAc,CAAC;AAAA,IAC9D;AAEA,QAAI,gBAAgB,aAAa,GAAG;AAClC,YAAM,OAAO,cAAc;AAAA,IAC7B;AAEA,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,SAAS,GAAG;AACtB,WAAO,IAAI,MAAM,GAAG,OAAO,aAAa,CAAC,KAAK,OAAO,EAAE;AAAA,EACzD;AAEA,SAAO,IAAI,MAAM,OAAO,aAAa,CAAC;AACxC","sourcesContent":["import { ErrorWithCause } from 'pony-cause';\n\nimport { isNullOrUndefined, isObject } from './misc';\n\n/**\n * Type guard for determining whether the given value is an instance of Error.\n * For errors generated via `fs.promises`, `error instanceof Error` won't work,\n * so we have to come up with another way of testing.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nfunction isError(error: unknown): error is Error {\n return (\n error instanceof Error ||\n (isObject(error) && error.constructor.name === 'Error')\n );\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `code` property such as the type of error that Node throws for filesystem\n * operations, etc.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithCode(error: unknown): error is { code: string } {\n return typeof error === 'object' && error !== null && 'code' in error;\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `message` property, such as an instance of Error.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithMessage(\n error: unknown,\n): error is { message: string } {\n return typeof error === 'object' && error !== null && 'message' in error;\n}\n\n/**\n * Type guard for determining whether the given value is an error object with a\n * `stack` property, such as an instance of Error.\n *\n * @param error - The object to check.\n * @returns A boolean.\n */\nexport function isErrorWithStack(error: unknown): error is { stack: string } {\n return typeof error === 'object' && error !== null && 'stack' in error;\n}\n\n/**\n * Attempts to obtain the message from a possible error object, defaulting to an\n * empty string if it is impossible to do so.\n *\n * @param error - The possible error to get the message from.\n * @returns The message if `error` is an object with a `message` property;\n * the string version of `error` if it is not `undefined` or `null`; otherwise\n * an empty string.\n */\nexport function getErrorMessage(error: unknown): string {\n if (isErrorWithMessage(error) && typeof error.message === 'string') {\n return error.message;\n }\n\n if (isNullOrUndefined(error)) {\n return '';\n }\n\n return String(error);\n}\n\n/**\n * Builds a new error object, linking it to the original error via the `cause`\n * property if it is an Error.\n *\n * This function is useful to reframe error messages in general, but is\n * _critical_ when interacting with any of Node's filesystem functions as\n * provided via `fs.promises`, because these do not produce stack traces in the\n * case of an I/O error (see <https://github.com/nodejs/node/issues/30944>).\n *\n * @param originalError - The error to be wrapped (something throwable).\n * @param message - The desired message of the new error.\n * @returns A new error object.\n */\nexport function wrapError<Throwable>(\n originalError: Throwable,\n message: string,\n): Error & { code?: string } {\n if (isError(originalError)) {\n let error: Error & { code?: string };\n if (Error.length === 2) {\n // for some reason `tsserver` is not complaining that the\n // Error constructor doesn't support a second argument in the editor,\n // but `tsc` does. Error causes are not supported by our current tsc target (ES2020, we need ES2022 to make this work)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n error = new Error(message, { cause: originalError });\n } else {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n error = new ErrorWithCause(message, { cause: originalError });\n }\n\n if (isErrorWithCode(originalError)) {\n error.code = originalError.code;\n }\n\n return error;\n }\n\n if (message.length > 0) {\n return new Error(`${String(originalError)}: ${message}`);\n }\n\n return new Error(String(originalError));\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assert
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
4
4
|
|
|
5
5
|
// src/base64.ts
|
|
6
6
|
import { pattern } from "superstruct";
|
|
@@ -32,4 +32,4 @@ var base64 = (struct, options = {}) => {
|
|
|
32
32
|
export {
|
|
33
33
|
base64
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-NQMRFZHB.mjs.map
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
StrictHexStruct,
|
|
3
3
|
bytesToHex,
|
|
4
4
|
hexToBytes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VA2DRBDE.mjs";
|
|
6
6
|
import {
|
|
7
7
|
assert
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
9
9
|
|
|
10
10
|
// src/coercers.ts
|
|
11
11
|
import {
|
|
@@ -92,4 +92,4 @@ export {
|
|
|
92
92
|
createBytes,
|
|
93
93
|
createHex
|
|
94
94
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-O3EIM33O.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkQVEKZRZ2js = require('./chunk-QVEKZRZ2.js');
|
|
@@ -60,7 +60,7 @@ var UnsafeJsonStruct = _superstruct.union.call(void 0, [
|
|
|
60
60
|
)
|
|
61
61
|
]);
|
|
62
62
|
var JsonStruct = _superstruct.coerce.call(void 0, UnsafeJsonStruct, _superstruct.any.call(void 0, ), (value) => {
|
|
63
|
-
|
|
63
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0, value, UnsafeJsonStruct);
|
|
64
64
|
return JSON.parse(
|
|
65
65
|
JSON.stringify(value, (propKey, propValue) => {
|
|
66
66
|
if (propKey === "__proto__" || propKey === "constructor") {
|
|
@@ -82,7 +82,7 @@ function getSafeJson(value) {
|
|
|
82
82
|
return _superstruct.create.call(void 0, value, JsonStruct);
|
|
83
83
|
}
|
|
84
84
|
function getJsonSize(value) {
|
|
85
|
-
|
|
85
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0, value, JsonStruct, "Invalid JSON value");
|
|
86
86
|
const json = JSON.stringify(value);
|
|
87
87
|
return new TextEncoder().encode(json).byteLength;
|
|
88
88
|
}
|
|
@@ -111,7 +111,7 @@ function isJsonRpcNotification(value) {
|
|
|
111
111
|
return _superstruct.is.call(void 0, value, JsonRpcNotificationStruct);
|
|
112
112
|
}
|
|
113
113
|
function assertIsJsonRpcNotification(value, ErrorWrapper) {
|
|
114
|
-
|
|
114
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0,
|
|
115
115
|
value,
|
|
116
116
|
JsonRpcNotificationStruct,
|
|
117
117
|
"Invalid JSON-RPC notification",
|
|
@@ -122,7 +122,7 @@ function isJsonRpcRequest(value) {
|
|
|
122
122
|
return _superstruct.is.call(void 0, value, JsonRpcRequestStruct);
|
|
123
123
|
}
|
|
124
124
|
function assertIsJsonRpcRequest(value, ErrorWrapper) {
|
|
125
|
-
|
|
125
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0,
|
|
126
126
|
value,
|
|
127
127
|
JsonRpcRequestStruct,
|
|
128
128
|
"Invalid JSON-RPC request",
|
|
@@ -153,7 +153,7 @@ function isPendingJsonRpcResponse(response) {
|
|
|
153
153
|
return _superstruct.is.call(void 0, response, PendingJsonRpcResponseStruct);
|
|
154
154
|
}
|
|
155
155
|
function assertIsPendingJsonRpcResponse(response, ErrorWrapper) {
|
|
156
|
-
|
|
156
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0,
|
|
157
157
|
response,
|
|
158
158
|
PendingJsonRpcResponseStruct,
|
|
159
159
|
"Invalid pending JSON-RPC response",
|
|
@@ -164,7 +164,7 @@ function isJsonRpcResponse(response) {
|
|
|
164
164
|
return _superstruct.is.call(void 0, response, JsonRpcResponseStruct);
|
|
165
165
|
}
|
|
166
166
|
function assertIsJsonRpcResponse(value, ErrorWrapper) {
|
|
167
|
-
|
|
167
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0,
|
|
168
168
|
value,
|
|
169
169
|
JsonRpcResponseStruct,
|
|
170
170
|
"Invalid JSON-RPC response",
|
|
@@ -175,7 +175,7 @@ function isJsonRpcSuccess(value) {
|
|
|
175
175
|
return _superstruct.is.call(void 0, value, JsonRpcSuccessStruct);
|
|
176
176
|
}
|
|
177
177
|
function assertIsJsonRpcSuccess(value, ErrorWrapper) {
|
|
178
|
-
|
|
178
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0,
|
|
179
179
|
value,
|
|
180
180
|
JsonRpcSuccessStruct,
|
|
181
181
|
"Invalid JSON-RPC success response",
|
|
@@ -186,7 +186,7 @@ function isJsonRpcFailure(value) {
|
|
|
186
186
|
return _superstruct.is.call(void 0, value, JsonRpcFailureStruct);
|
|
187
187
|
}
|
|
188
188
|
function assertIsJsonRpcFailure(value, ErrorWrapper) {
|
|
189
|
-
|
|
189
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0,
|
|
190
190
|
value,
|
|
191
191
|
JsonRpcFailureStruct,
|
|
192
192
|
"Invalid JSON-RPC failure response",
|
|
@@ -197,7 +197,7 @@ function isJsonRpcError(value) {
|
|
|
197
197
|
return _superstruct.is.call(void 0, value, JsonRpcErrorStruct);
|
|
198
198
|
}
|
|
199
199
|
function assertIsJsonRpcError(value, ErrorWrapper) {
|
|
200
|
-
|
|
200
|
+
_chunk6ZDHSOUVjs.assertStruct.call(void 0,
|
|
201
201
|
value,
|
|
202
202
|
JsonRpcErrorStruct,
|
|
203
203
|
"Invalid JSON-RPC error",
|
|
@@ -254,4 +254,4 @@ function getJsonRpcIdValidator(options) {
|
|
|
254
254
|
|
|
255
255
|
|
|
256
256
|
exports.object = object; exports.exactOptional = exactOptional; exports.UnsafeJsonStruct = UnsafeJsonStruct; exports.JsonStruct = JsonStruct; exports.isValidJson = isValidJson; exports.getSafeJson = getSafeJson; exports.getJsonSize = getJsonSize; exports.jsonrpc2 = jsonrpc2; exports.JsonRpcVersionStruct = JsonRpcVersionStruct; exports.JsonRpcIdStruct = JsonRpcIdStruct; exports.JsonRpcErrorStruct = JsonRpcErrorStruct; exports.JsonRpcParamsStruct = JsonRpcParamsStruct; exports.JsonRpcRequestStruct = JsonRpcRequestStruct; exports.JsonRpcNotificationStruct = JsonRpcNotificationStruct; exports.isJsonRpcNotification = isJsonRpcNotification; exports.assertIsJsonRpcNotification = assertIsJsonRpcNotification; exports.isJsonRpcRequest = isJsonRpcRequest; exports.assertIsJsonRpcRequest = assertIsJsonRpcRequest; exports.PendingJsonRpcResponseStruct = PendingJsonRpcResponseStruct; exports.JsonRpcSuccessStruct = JsonRpcSuccessStruct; exports.JsonRpcFailureStruct = JsonRpcFailureStruct; exports.JsonRpcResponseStruct = JsonRpcResponseStruct; exports.isPendingJsonRpcResponse = isPendingJsonRpcResponse; exports.assertIsPendingJsonRpcResponse = assertIsPendingJsonRpcResponse; exports.isJsonRpcResponse = isJsonRpcResponse; exports.assertIsJsonRpcResponse = assertIsJsonRpcResponse; exports.isJsonRpcSuccess = isJsonRpcSuccess; exports.assertIsJsonRpcSuccess = assertIsJsonRpcSuccess; exports.isJsonRpcFailure = isJsonRpcFailure; exports.assertIsJsonRpcFailure = assertIsJsonRpcFailure; exports.isJsonRpcError = isJsonRpcError; exports.assertIsJsonRpcError = assertIsJsonRpcError; exports.getJsonRpcIdValidator = getJsonRpcIdValidator;
|
|
257
|
-
//# sourceMappingURL=chunk-
|
|
257
|
+
//# sourceMappingURL=chunk-OLLG4H35.js.map
|