-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Join some overloads of string methods to union parameters #13738
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
Conversation
Fixes the string methods which accept either a string or RegExp as pattern. Also, some help texts were fixed to represent the actual behavior as per spec. See microsoft#5766
Hi @avonwyss, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
lib/lib.d.ts
Outdated
/** | ||
* Replaces text in a string, using a regular expression or search string. | ||
* @param searchValue A string that represents the regular expression. | ||
* Replaces text in a string, using a regular expression or search string. Only regular expression with global flag replaces all occurrences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you reword this to "When given a regular expression with its global flag set, this method replaces all occurrences. Otherwise, only the first match is replaced."
@avonwyss @DanielRosenwasser You need to edit the declarations of the src directory. See https://github.com/Microsoft/TypeScript/blob/master/lib/README.md https://github.com/Microsoft/TypeScript/blob/master/src/lib/es5.d.ts |
any updates? |
@falsandtru can you fix the merge conflict please? Sorry about that Ping @DanielRosenwasser for review |
done in #14639 |
Fixed by #14639 |
Fixes the string methods which accept either a string or RegExp as pattern. Also, some help texts were changed to represent the actual behavior as per ECMA spec (e.g. when it is a literal pattern and when a regular expression pattern).
Fixes #5766