Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Explanation - For runtime property assignment, use `as unknown as` instead of `as any`. - Change the types for `BaseControllerV1` class fields `initialConfig`, `initialState` from `C`, `S` to `Partial<C>`, `Partial<S>`. - Initial user-supplied constructor options do not need to be complete `C`, `S` objects, since `internal{Config,State}` will be populated with `default{Config,State}`. - For empty objects, prefer no type assertions or `as never` (`never` is assignable to all types). - Fix code written based on outdated TypeScript limitation. - Generic spread expressions for object literals are supported by TypeScript: microsoft/TypeScript#28234 ## References - Closes #3715 ## Changelog ### [`@metamask/base-controller`](https://github.com/MetaMask/core/pull/3959/files#diff-a8212838da15b445582e5622bd4cc8195e4c52bcf87210af8074555f806706a9) ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
- Loading branch information