Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add isEqualCaseInsensitive() to @metamask/controller-utils #4811

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jiexi
Copy link
Contributor

@jiexi jiexi commented Oct 17, 2024

Explanation

Moves isEqualCaseInsensitive() from assets-controllers into controller-utils because it will be used elsewhere downstream

References

Upstream: None. This is the start.
Downstream: #4812

Changelog

@metamask/controller-utils

  • ADDED: Export isEqualCaseInsensitive() helper which performs case insensitive comparison against two strings and returns true if they are equivalent.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@jiexi jiexi requested review from a team as code owners October 17, 2024 19:36
* @param value2 - first string to compare
* @returns true if 2 strings are identical when they are lowercase
*/
export function isEqualCaseInsensitive(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this is not exported outside of the assets-controller package, and therefore does not require a changelog item

Gudahtt
Gudahtt previously approved these changes Oct 17, 2024
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Gudahtt
Gudahtt previously approved these changes Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants