Skip to content

Commit 472584f

Browse files
committed
Changes to resolve pr comments
1 parent 34c3b9c commit 472584f

3 files changed

Lines changed: 52 additions & 6 deletions

File tree

src/lib/es2015.symbol.wellknown.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ interface String {
219219
match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;
220220

221221
/**
222-
* Replaces one or more occurrences of substrings that match the method provided by `searchValue`.
222+
* Passes a string and {@linkcode replaceValue} to the [Symbol.replace] method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.
223223
* @param searchValue An object that supports searching for and replacing matches within a string.
224-
* @param replacer The replacement text.
224+
* @param replaceValue The replacement text.
225225
*/
226226
replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
227227

src/lib/es5.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ interface String {
429429

430430
/**
431431
* Replaces text in a string, using a regular expression or search string.
432-
* @param searchValue A string to search for.
433-
* @param replaceValue A string containing the text to replace. When the searchvalue is a string, only the first match is replaced. If the searchValue is a Regexp, all matches are replaced if the g flag is set. Otherwise only the first one is.
432+
* @param searchValue A string or regular expression to search for.
433+
* @param replaceValue A string containing the text to replace. When the {@linkcode searchValue} is a string, only the first match is replaced. If the {@linkcode searchValue} is a RegExp, all matches are replaced if the g flag is set. Otherwise only the first one is.
434434
*/
435435
replace(searchValue: string | RegExp, replaceValue: string): string;
436436

tests/baselines/reference/completionsStringMethods.baseline

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@
10481048
"kind": "space"
10491049
},
10501050
{
1051-
"text": "A string to search for.",
1051+
"text": "A string or regular expression to search for.",
10521052
"kind": "text"
10531053
}
10541054
]
@@ -1065,7 +1065,53 @@
10651065
"kind": "space"
10661066
},
10671067
{
1068-
"text": "A string containing the text to replace for every successful match of searchValue in this string.",
1068+
"text": "A string containing the text to replace. When the ",
1069+
"kind": "text"
1070+
},
1071+
{
1072+
"text": "{@linkcode ",
1073+
"kind": "link"
1074+
},
1075+
{
1076+
"text": "searchValue",
1077+
"kind": "linkName",
1078+
"target": {
1079+
"fileName": "lib.d.ts",
1080+
"textSpan": {
1081+
"start": 19079,
1082+
"length": 28
1083+
}
1084+
}
1085+
},
1086+
{
1087+
"text": "}",
1088+
"kind": "link"
1089+
},
1090+
{
1091+
"text": " is a string, only the first match is replaced. If the ",
1092+
"kind": "text"
1093+
},
1094+
{
1095+
"text": "{@linkcode ",
1096+
"kind": "link"
1097+
},
1098+
{
1099+
"text": "searchValue",
1100+
"kind": "linkName",
1101+
"target": {
1102+
"fileName": "lib.d.ts",
1103+
"textSpan": {
1104+
"start": 19079,
1105+
"length": 28
1106+
}
1107+
}
1108+
},
1109+
{
1110+
"text": "}",
1111+
"kind": "link"
1112+
},
1113+
{
1114+
"text": " is a RegExp, all matches are replaced if the g flag is set. Otherwise only the first one is.",
10691115
"kind": "text"
10701116
}
10711117
]

0 commit comments

Comments
 (0)