@metamask/utils 2.1.0 → 3.0.0

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 CHANGED
@@ -6,6 +6,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.0.0]
10
+ ### Added
11
+ - Add logging functions ([#20](https://github.com/MetaMask/utils/pull/20))
12
+ - Add frozen collections (implemented in [#5](https://github.com/MetaMask/utils/pull/5) but exported in [#19](https://github.com/MetaMask/utils/pull/19))
13
+
14
+ ### Changed
15
+ - **BREAKING:** Improve types and type validation ([#19](https://github.com/MetaMask/utils/pull/19))
16
+ - Various type changes have been made that might be breaking:
17
+ - The `JsonRpcRequest` and `JsonRpcNotification` types now include a generic constraint requiring that the `Params` type extends the `JsonRpcParams` type.
18
+ - The `JsonRpcSuccess` and `JsonRpcResponse` types now include a generic contraint for the `Result` type, requiring that it extends the `Json` type.
19
+ - Various validation functions now accept `unknown` parameters rather than specific types. This should not be breaking except that it may affect type inference for the parameters passed in.
20
+ - New JSON-related functions have been added:
21
+ - `assertIsJsonRpcResponse`
22
+ - `isJsonRpcResponse`
23
+ - `InferWithParams`
24
+ - `JsonRpcParams`
25
+ - New JSON Struct types have been added:
26
+ - `JsonRpcErrorStruct`
27
+ - `JsonRpcFailureStruct`
28
+ - `JsonRpcIdStruct`
29
+ - `JsonRpcParamsStruct`
30
+ - `JsonRpcRequestStruct`
31
+ - `JsonRpcResponseStruct`
32
+ - `JsonRpcSuccessStruct`
33
+ - `JsonRpcVersionStruct`
34
+ - `JsonStruct`
35
+
9
36
  ## [2.1.0]
10
37
  ### Added
11
38
  - Add JSON storage validation and limit utilities ([#14](https://github.com/MetaMask/utils/pull/14))
@@ -23,7 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
50
  ### Added
24
51
  - Initial release
25
52
 
26
- [Unreleased]: https://github.com/MetaMask/utils/compare/v2.1.0...HEAD
53
+ [Unreleased]: https://github.com/MetaMask/utils/compare/v3.0.0...HEAD
54
+ [3.0.0]: https://github.com/MetaMask/utils/compare/v2.1.0...v3.0.0
27
55
  [2.1.0]: https://github.com/MetaMask/utils/compare/v2.0.0...v2.1.0
28
56
  [2.0.0]: https://github.com/MetaMask/utils/compare/v1.0.0...v2.0.0
29
57
  [1.0.0]: https://github.com/MetaMask/utils/releases/tag/v1.0.0
@@ -0,0 +1 @@
1
+ export * from './json';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./json"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/__fixtures__/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB","sourcesContent":["export * from './json';\n"]}