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

add trim method inference @ String. #135

Closed
wants to merge 3 commits into from

Conversation

igalklebanov
Copy link

@igalklebanov igalklebanov commented Apr 7, 2023

Hey 👋

This PR adds return type inference for String's .trim/.trimStart/.trimLeft/.trimEnd/.trimRight.

const moshe = '\t\n\r moshe \r\n\t'

moshe.trim() // 'moshe'
moshe.trimStart() // 'moshe \r\n\t'
moshe.trimLeft() // 'moshe \r\n\t'
moshe.trimRight() // '\t\n\r moshe'
moshe.trimEnd() // '\t\n\r moshe'

const notMoshe: string = moshe

notMoshe.trim() // string
notMoshe.trimStart() // string
notMoshe.trimLeft() // string
notMoshe.trimRight() // string
notMoshe.trimEnd() // string

@igalklebanov igalklebanov marked this pull request as ready for review April 7, 2023 16:51
@mattpocock
Copy link
Owner

Closing for reasons described here

@mattpocock mattpocock closed this May 27, 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.

2 participants