-
-
Notifications
You must be signed in to change notification settings - Fork 15
Comparing changes
Open a pull request
base repository: MetaMask/utils
base: 68384c6
head repository: MetaMask/utils
compare: 7f0116d
- 14 commits
- 37 files changed
- 12 contributors
Commits on Jul 11, 2023
-
Standardise repo per module template as of July 2023 (#115)
* Standardise repo per module template as of July 2023 * Fix some package-specific configs * Remove pull request template * Add pull request template again * Formatting
Configuration menu - View commit details
-
Copy full SHA for ab071ea - Browse repository at this point
Copy the full SHA ab071eaView commit details
Commits on Jul 13, 2023
-
Add getKnownPropertyNames (#111)
This function has been copied from various projects, where it is common to transform an enum into another data structure. For instance: ``` enum InfuraNetworkType { mainnet = 'mainnet', goerli = 'goerli', sepolia = 'sepolia', } const infuraNetworkClientConfigurations = Object.keys(InfuraNetworkType).map((network) => { const networkClientId = buildInfuraNetworkClientId(network); const networkClientConfiguration = { type: NetworkClientType.Infura, network, infuraProjectId: this.#infuraProjectId, }; return [networkClientId, networkClientConfiguration]; }); ``` As the above example, one could use `Object.keys()` or even `Object.getOwnPropertyNames()` to obtain said properties. A problem occurs, however, if the type of the properties of the resulting object needs to match the type of the properties in the enum, that means the variable inside the loop needs to be of that type, too. Both `Object.keys()` and `Object.getOwnPropertyNames()` are intentionally generic: they returns the property names of an object, but neither can make guarantees about the contents of that object, so the type of the property names is merely `string[]`. While this is technically accurate, we don't have to be so cautious in these situations, because we own the object in question and therefore know exactly which properties it has. This commit adds a `getKnownPropertyNames` function which is like `Object.getOwnPropertyNames()` except that the resulting array of property names will be typed using the types of the properties of the given object. In the above example that would mean that `network` would have a type of `InfuraNetworkType` and not `string`. Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>Configuration menu - View commit details
-
Copy full SHA for a1e5d90 - Browse repository at this point
Copy the full SHA a1e5d90View commit details
Commits on Jul 17, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 614b27c - Browse repository at this point
Copy the full SHA 614b27cView commit details
Commits on Jul 19, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 942bcd8 - Browse repository at this point
Copy the full SHA 942bcd8View commit details
Commits on Jul 24, 2023
-
BREAKING: Synchronise package with module template to fix ESM build (#…
…124) * Synchronise package with module template to fix ESM build * Dedupe dependencies
Configuration menu - View commit details
-
Copy full SHA for d94d13c - Browse repository at this point
Copy the full SHA d94d13cView commit details
Commits on Jul 25, 2023
-
Bump semver to ensure signed provenance, CVE fix (#123)
Co-authored-by: Craig Scheets <craig.scheets@consensys.io>
Configuration menu - View commit details
-
Copy full SHA for a244fa9 - Browse repository at this point
Copy the full SHA a244fa9View commit details -
* 7.0.0 * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
Configuration menu - View commit details
-
Copy full SHA for e5bc219 - Browse repository at this point
Copy the full SHA e5bc219View commit details
Commits on Aug 1, 2023
-
* add caip chain id * add parsing * Update parseCaipChainIdString behavior * lint * drop string suffix * Switch to @metamask/snap-utils caip types * lint * Separate regex const. Add CaipAccountAddressStruct * Add CaipAccountAddress specs * tighten types * remove unused types. cleanup specs. add fixtures * last bit
Configuration menu - View commit details
-
Copy full SHA for 2653a1a - Browse repository at this point
Copy the full SHA 2653a1aView commit details -
* 7.1.0 * update changelog * Update CHANGELOG.md Co-authored-by: Shane <jonas.shane@gmail.com> --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jiexi Luan <jiexiluan@gmail.com> Co-authored-by: Shane <jonas.shane@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4cffdd4 - Browse repository at this point
Copy the full SHA 4cffdd4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20bb059 - Browse repository at this point
Copy the full SHA 20bb059View commit details
Commits on Aug 28, 2023
-
Fix JsonRpcRequest to be valid json (#130)
fix/types: JsonRpcParams should be valid JSON values `undefined` is not valid JSON. https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf (Section 5): A JSON value can be an object, array, number, string, true, false, or null.
Configuration menu - View commit details
-
Copy full SHA for 2c612ff - Browse repository at this point
Copy the full SHA 2c612ffView commit details -
--------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: legobt <6wbvkn0j@anonaddy.me> Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 58b1611 - Browse repository at this point
Copy the full SHA 58b1611View commit details
Commits on Aug 31, 2023
-
fix(types): Optional JSON params where undefined is not valid (#134)
* fix(types): Optional JSON params where undefined is not valid * Reduce type duplication by excluding `undefined` --------- Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
Configuration menu - View commit details
-
Copy full SHA for e8cad2f - Browse repository at this point
Copy the full SHA e8cad2fView commit details -
Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com> --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: legobt <6wbvkn0j@anonaddy.me> Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
Configuration menu - View commit details
-
Copy full SHA for 7f0116d - Browse repository at this point
Copy the full SHA 7f0116dView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 68384c6...7f0116d