Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

fix: convert all arguments to lowercase #309

Closed
wants to merge 9 commits into from
Closed

Conversation

lze3
Copy link
Contributor

@lze3 lze3 commented May 21, 2020

If you're checking the lower-case value is included within an array that may not be lower-case, that's pointless and may result in cases where the condition is never true. For example, you want to match an upper-case string in a string[], but because this checks lower-case, it will never be true.

lze3 added 2 commits May 22, 2020 00:51
If you're checking the lower-case value is included within an array that may not be lower-case, that's pointless and may result in cases where the condition is never true. For example, you want to match an upper-case string in a string[], but because this checks lower-case, it will _never_ be true.
@Gawdl3y
Copy link
Member

Gawdl3y commented Aug 5, 2020

All items in oneOf should be specified as lowercase. This is to avoid having to call toLowerCase on args every time like in this PR. Ideally, there should probably be validation on construction to verify that oneOf doesn't contain any non-lowercase entries (or just make them all lowercase at that time).

@lze3

This comment has been minimized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants