Skip to content

Fix resulting end position when endIndex is 0 for rangeBy#1932

Merged
ai merged 2 commits intopostcss:mainfrom
romainmenke:fix-warning-end-index--inventive-numbat-fbada42105
Mar 20, 2024
Merged

Fix resulting end position when endIndex is 0 for rangeBy#1932
ai merged 2 commits intopostcss:mainfrom
romainmenke:fix-warning-end-index--inventive-numbat-fbada42105

Conversation

@romainmenke
Copy link
Contributor

@romainmenke romainmenke commented Mar 20, 2024

When endIndex is exactly 0 it is ignored and the end position will fallback to the end of the node.

Checking that it is a number instead of a simpler boolean check does seem to work as I would expect.

@romainmenke romainmenke changed the title failing test: for endIndex 0 in rangeBy Fix resulting end position when endIndex is 0 for rangeBy Mar 20, 2024
@ai ai merged commit c1ad8fb into postcss:main Mar 20, 2024
@ai
Copy link
Member

ai commented Mar 20, 2024

Do we have a real use case? If yes, I can release it today (if not, I will wait another changes).

@romainmenke
Copy link
Contributor Author

Working on this for Stylelint: stylelint/stylelint#7518
It isn't causing issues for end users. It would be nice to have for me, so that I can finish work there.

But please take your time, I always have plenty to do 😅

@romainmenke romainmenke deleted the fix-warning-end-index--inventive-numbat-fbada42105 branch March 20, 2024 17:57
@ai
Copy link
Member

ai commented Mar 20, 2024

Thanks. Released in 8.4.38.

@romainmenke
Copy link
Contributor Author

Thank you 🙇

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.

2 participants