@metamask/utils 2.0.0 → 3.0.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 CHANGED
@@ -6,6 +6,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.0.1]
10
+ ### Fixed
11
+ - Promote `@types/debug` from development dependencies to production dependencies ([#23](https://github.com/MetaMask/utils/pull/23))
12
+
13
+ ## [3.0.0]
14
+ ### Added
15
+ - Add logging functions ([#20](https://github.com/MetaMask/utils/pull/20))
16
+ - Add frozen collections (implemented in [#5](https://github.com/MetaMask/utils/pull/5) but exported in [#19](https://github.com/MetaMask/utils/pull/19))
17
+
18
+ ### Changed
19
+ - **BREAKING:** Improve types and type validation ([#19](https://github.com/MetaMask/utils/pull/19))
20
+ - Various type changes have been made that might be breaking:
21
+ - The `JsonRpcRequest` and `JsonRpcNotification` types now include a generic constraint requiring that the `Params` type extends the `JsonRpcParams` type.
22
+ - The `JsonRpcSuccess` and `JsonRpcResponse` types now include a generic contraint for the `Result` type, requiring that it extends the `Json` type.
23
+ - 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.
24
+ - New JSON-related functions have been added:
25
+ - `assertIsJsonRpcResponse`
26
+ - `isJsonRpcResponse`
27
+ - `InferWithParams`
28
+ - `JsonRpcParams`
29
+ - New JSON Struct types have been added:
30
+ - `JsonRpcErrorStruct`
31
+ - `JsonRpcFailureStruct`
32
+ - `JsonRpcIdStruct`
33
+ - `JsonRpcParamsStruct`
34
+ - `JsonRpcRequestStruct`
35
+ - `JsonRpcResponseStruct`
36
+ - `JsonRpcSuccessStruct`
37
+ - `JsonRpcVersionStruct`
38
+ - `JsonStruct`
39
+
40
+ ## [2.1.0]
41
+ ### Added
42
+ - Add JSON storage validation and limit utilities ([#14](https://github.com/MetaMask/utils/pull/14))
43
+ - Adds a new function `validateJsonAndGetSize`.
44
+
9
45
  ## [2.0.0]
10
46
  ### Added
11
47
  - Add more JSON utils ([#8](https://github.com/MetaMask/utils/pull/8))
@@ -18,6 +54,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
18
54
  ### Added
19
55
  - Initial release
20
56
 
21
- [Unreleased]: https://github.com/MetaMask/utils/compare/v2.0.0...HEAD
57
+ [Unreleased]: https://github.com/MetaMask/utils/compare/v3.0.1...HEAD
58
+ [3.0.1]: https://github.com/MetaMask/utils/compare/v3.0.0...v3.0.1
59
+ [3.0.0]: https://github.com/MetaMask/utils/compare/v2.1.0...v3.0.0
60
+ [2.1.0]: https://github.com/MetaMask/utils/compare/v2.0.0...v2.1.0
22
61
  [2.0.0]: https://github.com/MetaMask/utils/compare/v1.0.0...v2.0.0
23
62
  [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"]}