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

StringSlice: Fix return type when passing in non-literal #1036

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

ghaaj
Copy link
Contributor

@ghaaj ghaaj commented Jan 13, 2025

Closes #1035
This PR modifies the behavior of StringSlice so that it returns string instead of string[] when S is non-literal string.

@ghaaj ghaaj changed the title Issue 1035 StringSlice: Return string instead of string[] when the type parameter S is not a literal Jan 13, 2025
Copy link
Collaborator

@som-sm som-sm left a comment

Choose a reason for hiding this comment

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

Makes sense!

@sindresorhus sindresorhus merged commit 979eccf into sindresorhus:main Jan 14, 2025
12 checks passed
@sindresorhus sindresorhus changed the title StringSlice: Return string instead of string[] when the type parameter S is not a literal StringSlice: Fix return type when passing in non-literal Jan 14, 2025
@ghaaj ghaaj deleted the issue-1035 branch January 14, 2025 03:58
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.

StringSlice<S, Start, End> returns incorrect type when S is non-literal string
3 participants