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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add trim method inference @ String. #135

Open
wants to merge 2 commits into
base: main
Choose a base branch
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
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.

None yet

1 participant