@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/dist/node.js
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkBFQDMI3Mjs = require('./chunk-BFQDMI3M.js');
|
|
12
12
|
require('./chunk-2TBCL6EF.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkVFXTVNXNjs = require('./chunk-VFXTVNXN.js');
|
|
19
19
|
require('./chunk-LC2CRSWD.js');
|
|
20
20
|
|
|
21
21
|
|
|
@@ -33,7 +33,7 @@ require('./chunk-UOTVU7OQ.js');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _chunk4D6XQBHAjs = require('./chunk-4D6XQBHA.js');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
@@ -68,7 +68,7 @@ var _chunkZRNIY7OWjs = require('./chunk-ZRNIY7OW.js');
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
var
|
|
71
|
+
var _chunkOLLG4H35js = require('./chunk-OLLG4H35.js');
|
|
72
72
|
require('./chunk-RKRGAFXY.js');
|
|
73
73
|
|
|
74
74
|
|
|
@@ -95,16 +95,16 @@ var _chunk2LBGT4GHjs = require('./chunk-2LBGT4GH.js');
|
|
|
95
95
|
var _chunkU7ZUGCE7js = require('./chunk-U7ZUGCE7.js');
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
var
|
|
98
|
+
var _chunkE4C7EW4Rjs = require('./chunk-E4C7EW4R.js');
|
|
99
99
|
|
|
100
100
|
|
|
101
|
-
var
|
|
101
|
+
var _chunk6NZW4WK4js = require('./chunk-6NZW4WK4.js');
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
var
|
|
107
|
+
var _chunkDHVKFDHQjs = require('./chunk-DHVKFDHQ.js');
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
@@ -136,20 +136,20 @@ var _chunkJCYFTGEDjs = require('./chunk-JCYFTGED.js');
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
var
|
|
139
|
+
var _chunkQEPVHEP7js = require('./chunk-QEPVHEP7.js');
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
var
|
|
145
|
+
var _chunk6ZDHSOUVjs = require('./chunk-6ZDHSOUV.js');
|
|
146
146
|
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
var
|
|
152
|
+
var _chunkIZC266HSjs = require('./chunk-IZC266HS.js');
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
|
|
@@ -305,5 +305,5 @@ require('./chunk-EQMZL4XU.js');
|
|
|
305
305
|
|
|
306
306
|
|
|
307
307
|
|
|
308
|
-
exports.AssertionError =
|
|
308
|
+
exports.AssertionError = _chunk6ZDHSOUVjs.AssertionError; exports.CAIP_ACCOUNT_ADDRESS_REGEX = _chunkU7ZUGCE7js.CAIP_ACCOUNT_ADDRESS_REGEX; exports.CAIP_ACCOUNT_ID_REGEX = _chunkU7ZUGCE7js.CAIP_ACCOUNT_ID_REGEX; exports.CAIP_CHAIN_ID_REGEX = _chunkU7ZUGCE7js.CAIP_CHAIN_ID_REGEX; exports.CAIP_NAMESPACE_REGEX = _chunkU7ZUGCE7js.CAIP_NAMESPACE_REGEX; exports.CAIP_REFERENCE_REGEX = _chunkU7ZUGCE7js.CAIP_REFERENCE_REGEX; exports.CaipAccountAddressStruct = _chunkU7ZUGCE7js.CaipAccountAddressStruct; exports.CaipAccountIdStruct = _chunkU7ZUGCE7js.CaipAccountIdStruct; exports.CaipChainIdStruct = _chunkU7ZUGCE7js.CaipChainIdStruct; exports.CaipNamespaceStruct = _chunkU7ZUGCE7js.CaipNamespaceStruct; exports.CaipReferenceStruct = _chunkU7ZUGCE7js.CaipReferenceStruct; exports.ChecksumStruct = _chunkE4C7EW4Rjs.ChecksumStruct; exports.Duration = _chunk4RMX5YWEjs.Duration; exports.ESCAPE_CHARACTERS_REGEXP = _chunkQVEKZRZ2js.ESCAPE_CHARACTERS_REGEXP; exports.FrozenMap = _chunkZ2RGWDD7js.FrozenMap; exports.FrozenSet = _chunkZ2RGWDD7js.FrozenSet; exports.HexAddressStruct = _chunkQEPVHEP7js.HexAddressStruct; exports.HexChecksumAddressStruct = _chunkQEPVHEP7js.HexChecksumAddressStruct; exports.HexStruct = _chunkQEPVHEP7js.HexStruct; exports.JsonRpcErrorStruct = _chunkOLLG4H35js.JsonRpcErrorStruct; exports.JsonRpcFailureStruct = _chunkOLLG4H35js.JsonRpcFailureStruct; exports.JsonRpcIdStruct = _chunkOLLG4H35js.JsonRpcIdStruct; exports.JsonRpcNotificationStruct = _chunkOLLG4H35js.JsonRpcNotificationStruct; exports.JsonRpcParamsStruct = _chunkOLLG4H35js.JsonRpcParamsStruct; exports.JsonRpcRequestStruct = _chunkOLLG4H35js.JsonRpcRequestStruct; exports.JsonRpcResponseStruct = _chunkOLLG4H35js.JsonRpcResponseStruct; exports.JsonRpcSuccessStruct = _chunkOLLG4H35js.JsonRpcSuccessStruct; exports.JsonRpcVersionStruct = _chunkOLLG4H35js.JsonRpcVersionStruct; exports.JsonSize = _chunkQVEKZRZ2js.JsonSize; exports.JsonStruct = _chunkOLLG4H35js.JsonStruct; exports.PendingJsonRpcResponseStruct = _chunkOLLG4H35js.PendingJsonRpcResponseStruct; exports.StrictHexStruct = _chunkQEPVHEP7js.StrictHexStruct; exports.UnsafeJsonStruct = _chunkOLLG4H35js.UnsafeJsonStruct; exports.VersionRangeStruct = _chunk4D6XQBHAjs.VersionRangeStruct; exports.VersionStruct = _chunk4D6XQBHAjs.VersionStruct; exports.add0x = _chunkQEPVHEP7js.add0x; exports.assert = _chunk6ZDHSOUVjs.assert; exports.assertExhaustive = _chunk6ZDHSOUVjs.assertExhaustive; exports.assertIsBytes = _chunkQEPVHEP7js.assertIsBytes; exports.assertIsHexString = _chunkQEPVHEP7js.assertIsHexString; exports.assertIsJsonRpcError = _chunkOLLG4H35js.assertIsJsonRpcError; exports.assertIsJsonRpcFailure = _chunkOLLG4H35js.assertIsJsonRpcFailure; exports.assertIsJsonRpcNotification = _chunkOLLG4H35js.assertIsJsonRpcNotification; exports.assertIsJsonRpcRequest = _chunkOLLG4H35js.assertIsJsonRpcRequest; exports.assertIsJsonRpcResponse = _chunkOLLG4H35js.assertIsJsonRpcResponse; exports.assertIsJsonRpcSuccess = _chunkOLLG4H35js.assertIsJsonRpcSuccess; exports.assertIsPendingJsonRpcResponse = _chunkOLLG4H35js.assertIsPendingJsonRpcResponse; exports.assertIsSemVerRange = _chunk4D6XQBHAjs.assertIsSemVerRange; exports.assertIsSemVerVersion = _chunk4D6XQBHAjs.assertIsSemVerVersion; exports.assertIsStrictHexString = _chunkQEPVHEP7js.assertIsStrictHexString; exports.assertStruct = _chunk6ZDHSOUVjs.assertStruct; exports.base64 = _chunk6NZW4WK4js.base64; exports.base64ToBytes = _chunkQEPVHEP7js.base64ToBytes; exports.bigIntToBytes = _chunkQEPVHEP7js.bigIntToBytes; exports.bigIntToHex = _chunkVFXTVNXNjs.bigIntToHex; 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.calculateNumberSize = _chunkQVEKZRZ2js.calculateNumberSize; exports.calculateStringSize = _chunkQVEKZRZ2js.calculateStringSize; exports.concatBytes = _chunkQEPVHEP7js.concatBytes; exports.createBigInt = _chunkDHVKFDHQjs.createBigInt; exports.createBytes = _chunkDHVKFDHQjs.createBytes; exports.createDataView = _chunkQEPVHEP7js.createDataView; exports.createHex = _chunkDHVKFDHQjs.createHex; exports.createModuleLogger = _chunk2LBGT4GHjs.createModuleLogger; exports.createNumber = _chunkDHVKFDHQjs.createNumber; exports.createProjectLogger = _chunk2LBGT4GHjs.createProjectLogger; exports.createSandbox = _chunkBFQDMI3Mjs.createSandbox; exports.directoryExists = _chunkBFQDMI3Mjs.directoryExists; exports.ensureDirectoryStructureExists = _chunkBFQDMI3Mjs.ensureDirectoryStructureExists; exports.exactOptional = _chunkOLLG4H35js.exactOptional; exports.fileExists = _chunkBFQDMI3Mjs.fileExists; exports.forceRemove = _chunkBFQDMI3Mjs.forceRemove; exports.getChecksumAddress = _chunkQEPVHEP7js.getChecksumAddress; exports.getErrorMessage = _chunkIZC266HSjs.getErrorMessage; exports.getJsonRpcIdValidator = _chunkOLLG4H35js.getJsonRpcIdValidator; exports.getJsonSize = _chunkOLLG4H35js.getJsonSize; exports.getKnownPropertyNames = _chunkQVEKZRZ2js.getKnownPropertyNames; exports.getSafeJson = _chunkOLLG4H35js.getSafeJson; exports.gtRange = _chunk4D6XQBHAjs.gtRange; exports.gtVersion = _chunk4D6XQBHAjs.gtVersion; exports.hasProperty = _chunkQVEKZRZ2js.hasProperty; exports.hexToBigInt = _chunkVFXTVNXNjs.hexToBigInt; exports.hexToBytes = _chunkQEPVHEP7js.hexToBytes; exports.hexToNumber = _chunkVFXTVNXNjs.hexToNumber; exports.inMilliseconds = _chunk4RMX5YWEjs.inMilliseconds; exports.isASCII = _chunkQVEKZRZ2js.isASCII; exports.isBytes = _chunkQEPVHEP7js.isBytes; exports.isCaipAccountAddress = _chunkU7ZUGCE7js.isCaipAccountAddress; exports.isCaipAccountId = _chunkU7ZUGCE7js.isCaipAccountId; exports.isCaipChainId = _chunkU7ZUGCE7js.isCaipChainId; exports.isCaipNamespace = _chunkU7ZUGCE7js.isCaipNamespace; exports.isCaipReference = _chunkU7ZUGCE7js.isCaipReference; exports.isErrorWithCode = _chunkIZC266HSjs.isErrorWithCode; exports.isErrorWithMessage = _chunkIZC266HSjs.isErrorWithMessage; exports.isErrorWithStack = _chunkIZC266HSjs.isErrorWithStack; exports.isHexString = _chunkQEPVHEP7js.isHexString; exports.isJsonRpcError = _chunkOLLG4H35js.isJsonRpcError; exports.isJsonRpcFailure = _chunkOLLG4H35js.isJsonRpcFailure; exports.isJsonRpcNotification = _chunkOLLG4H35js.isJsonRpcNotification; exports.isJsonRpcRequest = _chunkOLLG4H35js.isJsonRpcRequest; exports.isJsonRpcResponse = _chunkOLLG4H35js.isJsonRpcResponse; exports.isJsonRpcSuccess = _chunkOLLG4H35js.isJsonRpcSuccess; exports.isNonEmptyArray = _chunkQVEKZRZ2js.isNonEmptyArray; exports.isNullOrUndefined = _chunkQVEKZRZ2js.isNullOrUndefined; exports.isObject = _chunkQVEKZRZ2js.isObject; exports.isPendingJsonRpcResponse = _chunkOLLG4H35js.isPendingJsonRpcResponse; exports.isPlainObject = _chunkQVEKZRZ2js.isPlainObject; exports.isStrictHexString = _chunkQEPVHEP7js.isStrictHexString; exports.isValidChecksumAddress = _chunkQEPVHEP7js.isValidChecksumAddress; exports.isValidHexAddress = _chunkQEPVHEP7js.isValidHexAddress; exports.isValidJson = _chunkOLLG4H35js.isValidJson; exports.isValidSemVerRange = _chunk4D6XQBHAjs.isValidSemVerRange; exports.isValidSemVerVersion = _chunk4D6XQBHAjs.isValidSemVerVersion; exports.jsonrpc2 = _chunkOLLG4H35js.jsonrpc2; exports.numberToBytes = _chunkQEPVHEP7js.numberToBytes; exports.numberToHex = _chunkVFXTVNXNjs.numberToHex; exports.object = _chunkOLLG4H35js.object; exports.parseCaipAccountId = _chunkU7ZUGCE7js.parseCaipAccountId; exports.parseCaipChainId = _chunkU7ZUGCE7js.parseCaipChainId; exports.readFile = _chunkBFQDMI3Mjs.readFile; exports.readJsonFile = _chunkBFQDMI3Mjs.readJsonFile; exports.remove0x = _chunkQEPVHEP7js.remove0x; exports.satisfiesVersionRange = _chunk4D6XQBHAjs.satisfiesVersionRange; exports.signedBigIntToBytes = _chunkQEPVHEP7js.signedBigIntToBytes; exports.stringToBytes = _chunkQEPVHEP7js.stringToBytes; exports.timeSince = _chunk4RMX5YWEjs.timeSince; exports.valueToBytes = _chunkQEPVHEP7js.valueToBytes; exports.wrapError = _chunkIZC266HSjs.wrapError; exports.writeFile = _chunkBFQDMI3Mjs.writeFile; exports.writeJsonFile = _chunkBFQDMI3Mjs.writeJsonFile;
|
|
309
309
|
//# sourceMappingURL=node.js.map
|
package/dist/node.mjs
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
readJsonFile,
|
|
9
9
|
writeFile,
|
|
10
10
|
writeJsonFile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-52OU772R.mjs";
|
|
12
12
|
import "./chunk-DYMCEQIV.mjs";
|
|
13
13
|
import {
|
|
14
14
|
bigIntToHex,
|
|
15
15
|
hexToBigInt,
|
|
16
16
|
hexToNumber,
|
|
17
17
|
numberToHex
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-S3UHBN2Z.mjs";
|
|
19
19
|
import "./chunk-AY6FDCBT.mjs";
|
|
20
20
|
import {
|
|
21
21
|
Duration,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
isValidSemVerRange,
|
|
34
34
|
isValidSemVerVersion,
|
|
35
35
|
satisfiesVersionRange
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-ROQSKDP5.mjs";
|
|
37
37
|
import {
|
|
38
38
|
JsonRpcErrorStruct,
|
|
39
39
|
JsonRpcFailureStruct,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
isValidJson,
|
|
69
69
|
jsonrpc2,
|
|
70
70
|
object
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-6C35XQOF.mjs";
|
|
72
72
|
import "./chunk-I575FZFH.mjs";
|
|
73
73
|
import {
|
|
74
74
|
createModuleLogger,
|
|
@@ -95,16 +95,16 @@ import {
|
|
|
95
95
|
} from "./chunk-TGOMTREC.mjs";
|
|
96
96
|
import {
|
|
97
97
|
ChecksumStruct
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-GZS3IQBZ.mjs";
|
|
99
99
|
import {
|
|
100
100
|
base64
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-NQMRFZHB.mjs";
|
|
102
102
|
import {
|
|
103
103
|
createBigInt,
|
|
104
104
|
createBytes,
|
|
105
105
|
createHex,
|
|
106
106
|
createNumber
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-O3EIM33O.mjs";
|
|
108
108
|
import {
|
|
109
109
|
HexAddressStruct,
|
|
110
110
|
HexChecksumAddressStruct,
|
|
@@ -136,20 +136,20 @@ import {
|
|
|
136
136
|
signedBigIntToBytes,
|
|
137
137
|
stringToBytes,
|
|
138
138
|
valueToBytes
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-VA2DRBDE.mjs";
|
|
140
140
|
import {
|
|
141
141
|
AssertionError,
|
|
142
142
|
assert,
|
|
143
143
|
assertExhaustive,
|
|
144
144
|
assertStruct
|
|
145
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-74DGVJVE.mjs";
|
|
146
146
|
import {
|
|
147
147
|
getErrorMessage,
|
|
148
148
|
isErrorWithCode,
|
|
149
149
|
isErrorWithMessage,
|
|
150
150
|
isErrorWithStack,
|
|
151
151
|
wrapError
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-XYGUOY6N.mjs";
|
|
153
153
|
import {
|
|
154
154
|
ESCAPE_CHARACTERS_REGEXP,
|
|
155
155
|
JsonSize,
|
package/dist/number.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
6
|
+
var _chunkVFXTVNXNjs = require('./chunk-VFXTVNXN.js');
|
|
7
|
+
require('./chunk-QEPVHEP7.js');
|
|
8
|
+
require('./chunk-6ZDHSOUV.js');
|
|
9
|
+
require('./chunk-IZC266HS.js');
|
|
10
10
|
require('./chunk-QVEKZRZ2.js');
|
|
11
11
|
require('./chunk-3W5G4CYI.js');
|
|
12
12
|
|
|
@@ -14,5 +14,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.bigIntToHex =
|
|
17
|
+
exports.bigIntToHex = _chunkVFXTVNXNjs.bigIntToHex; exports.hexToBigInt = _chunkVFXTVNXNjs.hexToBigInt; exports.hexToNumber = _chunkVFXTVNXNjs.hexToNumber; exports.numberToHex = _chunkVFXTVNXNjs.numberToHex;
|
|
18
18
|
//# sourceMappingURL=number.js.map
|
package/dist/number.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
hexToBigInt,
|
|
4
4
|
hexToNumber,
|
|
5
5
|
numberToHex
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-S3UHBN2Z.mjs";
|
|
7
|
+
import "./chunk-VA2DRBDE.mjs";
|
|
8
|
+
import "./chunk-74DGVJVE.mjs";
|
|
9
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
10
10
|
import "./chunk-H4YFDLB7.mjs";
|
|
11
11
|
import "./chunk-X66SUIEF.mjs";
|
|
12
12
|
export {
|
package/dist/versions.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
11
|
+
var _chunk4D6XQBHAjs = require('./chunk-4D6XQBHA.js');
|
|
12
|
+
require('./chunk-6ZDHSOUV.js');
|
|
13
|
+
require('./chunk-IZC266HS.js');
|
|
14
14
|
require('./chunk-QVEKZRZ2.js');
|
|
15
15
|
require('./chunk-3W5G4CYI.js');
|
|
16
16
|
|
|
@@ -23,5 +23,5 @@ require('./chunk-3W5G4CYI.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.VersionRangeStruct =
|
|
26
|
+
exports.VersionRangeStruct = _chunk4D6XQBHAjs.VersionRangeStruct; exports.VersionStruct = _chunk4D6XQBHAjs.VersionStruct; exports.assertIsSemVerRange = _chunk4D6XQBHAjs.assertIsSemVerRange; exports.assertIsSemVerVersion = _chunk4D6XQBHAjs.assertIsSemVerVersion; exports.gtRange = _chunk4D6XQBHAjs.gtRange; exports.gtVersion = _chunk4D6XQBHAjs.gtVersion; exports.isValidSemVerRange = _chunk4D6XQBHAjs.isValidSemVerRange; exports.isValidSemVerVersion = _chunk4D6XQBHAjs.isValidSemVerVersion; exports.satisfiesVersionRange = _chunk4D6XQBHAjs.satisfiesVersionRange;
|
|
27
27
|
//# sourceMappingURL=versions.js.map
|
package/dist/versions.mjs
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
isValidSemVerRange,
|
|
9
9
|
isValidSemVerVersion,
|
|
10
10
|
satisfiesVersionRange
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-ROQSKDP5.mjs";
|
|
12
|
+
import "./chunk-74DGVJVE.mjs";
|
|
13
|
+
import "./chunk-XYGUOY6N.mjs";
|
|
14
14
|
import "./chunk-H4YFDLB7.mjs";
|
|
15
15
|
import "./chunk-X66SUIEF.mjs";
|
|
16
16
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/utils",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.1",
|
|
4
4
|
"description": "Various JavaScript/TypeScript utilities of wide relevance to the MetaMask codebase",
|
|
5
5
|
"homepage": "https://github.com/MetaMask/utils#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"stdio-mock": "^1.2.0",
|
|
92
92
|
"ts-jest": "^29.0.3",
|
|
93
93
|
"ts-node": "^10.7.0",
|
|
94
|
-
"tsd": "^0.
|
|
94
|
+
"tsd": "^0.29.0",
|
|
95
95
|
"tsup": "^7.2.0",
|
|
96
96
|
"typedoc": "^0.23.15",
|
|
97
97
|
"typescript": "~4.8.4"
|
package/dist/chunk-4JNG5UTO.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkYQJBIHC7js = require('./chunk-YQJBIHC7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkVBYRLAP6js = require('./chunk-VBYRLAP6.js');
|
|
8
|
-
|
|
9
|
-
// src/number.ts
|
|
10
|
-
var numberToHex = (value) => {
|
|
11
|
-
_chunkVBYRLAP6js.assert.call(void 0, typeof value === "number", "Value must be a number.");
|
|
12
|
-
_chunkVBYRLAP6js.assert.call(void 0, value >= 0, "Value must be a non-negative number.");
|
|
13
|
-
_chunkVBYRLAP6js.assert.call(void 0,
|
|
14
|
-
Number.isSafeInteger(value),
|
|
15
|
-
"Value is not a safe integer. Use `bigIntToHex` instead."
|
|
16
|
-
);
|
|
17
|
-
return _chunkYQJBIHC7js.add0x.call(void 0, value.toString(16));
|
|
18
|
-
};
|
|
19
|
-
var bigIntToHex = (value) => {
|
|
20
|
-
_chunkVBYRLAP6js.assert.call(void 0, typeof value === "bigint", "Value must be a bigint.");
|
|
21
|
-
_chunkVBYRLAP6js.assert.call(void 0, value >= 0, "Value must be a non-negative bigint.");
|
|
22
|
-
return _chunkYQJBIHC7js.add0x.call(void 0, value.toString(16));
|
|
23
|
-
};
|
|
24
|
-
var hexToNumber = (value) => {
|
|
25
|
-
_chunkYQJBIHC7js.assertIsHexString.call(void 0, value);
|
|
26
|
-
const numberValue = parseInt(value, 16);
|
|
27
|
-
_chunkVBYRLAP6js.assert.call(void 0,
|
|
28
|
-
Number.isSafeInteger(numberValue),
|
|
29
|
-
"Value is not a safe integer. Use `hexToBigInt` instead."
|
|
30
|
-
);
|
|
31
|
-
return numberValue;
|
|
32
|
-
};
|
|
33
|
-
var hexToBigInt = (value) => {
|
|
34
|
-
_chunkYQJBIHC7js.assertIsHexString.call(void 0, value);
|
|
35
|
-
return BigInt(_chunkYQJBIHC7js.add0x.call(void 0, value));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
exports.numberToHex = numberToHex; exports.bigIntToHex = bigIntToHex; exports.hexToNumber = hexToNumber; exports.hexToBigInt = hexToBigInt;
|
|
44
|
-
//# sourceMappingURL=chunk-4JNG5UTO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,UAAM,QACJ,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUb,IAAI,MAAM,SAAS,EAAE,OAAO,cAAc,CAAC;AAAA,QAC3C,IAAI,eAAe,SAAS,EAAE,OAAO,cAAc,CAAC;AAE1D,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 const error: Error & { code?: string } =\n Error.length === 2\n ? // This branch is getting tested by using the Node version that\n // supports `cause` on the Error constructor.\n // istanbul ignore next\n // Also, 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. I'm not sure why, but we disable this in the\n // meantime.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n new Error(message, { cause: originalError })\n : new ErrorWithCause(message, { cause: originalError });\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"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|