You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typo in String#match (lib.es2015.symbol.wellknown) #36299
/** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
readonlysource: string;
The last part of the comment of the comment doesn't seem relevant:
The regExp argument is a Regular expression object. It can be a variable name or a literal.
My guess is that is the description for the regexp param taken by #match, which reads very similar:
/**
* Replaces text in a string, using an object that supports replacement within a string.
* @param searchValue A object can search for and replace matches within a string.
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
*/
replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match. If pattern is a string, only the first occurrence will be replaced.
Activity
G-Rath commentedon Feb 18, 2020
I've just found a similar typo in the
RegExpinterface ines5.lib:TypeScript/src/lib/es5.d.ts
Lines 912 to 913 in d2c5d54
The last part of the comment of the comment doesn't seem relevant:
My guess is that is the description for the
regexpparam taken by#match, which reads very similar:TypeScript/src/lib/es5.d.ts
Lines 416 to 420 in d2c5d54
sebmjoll commentedon Mar 6, 2020
I have found another comment issue in replace():
This comment is misleading because this function replaces all occurrences when the pattern is a regular expression but only the first occurrence when it is a literal as explained in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace :
which is confirmed by running the following code:
Remove misplaced parameter description from RegExp#source JSDoc