Repository navigation
feat!: put the lowercase argument first in str_starts_with and str_index_of - #320
Merged
Merged
Conversation
…dex_of Matches str_equals(lowercase, str). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
| 📦 Package | 📏 Base Size | 📏 Source Size | 📈 Size Change |
|---|---|---|---|
| @projectwallace/css-parser | 47.4 kB | 47.5 kB | +153 B |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
str_starts_withandstr_index_ofnow take the lowercase argument first, matchingstr_equals(lowercase, str). All three string helpers now share the same argument order. The README no longer carries the "this inconsistency will be fixed" note.str_equals_rangeis unchanged.Breaking changes
str_starts_withstr_starts_with(str, prefix)str_starts_with(prefix, str)str_index_ofstr_index_of(str, searchChar)str_index_of(searchChar, str)Both are exported from the package root and from
@projectwallace/css-parser/string-utils.Migration steps (for the changelog)
The old and new signatures are both
(string, string), so TypeScript will not flag callers that still use the old order. Update every call site by hand.str_starts_with(andstr_index_of(.str_equalsalready used this order, so it needs no change.Test plan
pnpm exec tsc --noEmitpnpm test --run(1496 passed)Generated by Claude Code