Merge pull request #14639 from falsandtru/lib.d.ts/overload

Convert overloads to unions
This commit is contained in:
Mohamed Hegazy 2017-03-13 16:33:42 -07:00 committed by GitHub
commit ea57fbc59f
13 changed files with 51 additions and 84 deletions

47
src/lib/es5.d.ts vendored
View File

@ -325,53 +325,27 @@ interface String {
* Matches a string with a regular expression, and returns an array containing the results of that search.
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
*/
match(regexp: string): RegExpMatchArray | null;
/**
* Matches a string with a regular expression, and returns an array containing the results of that search.
* @param regexp A regular expression object that contains the regular expression pattern and applicable flags.
*/
match(regexp: RegExp): RegExpMatchArray | null;
match(regexp: string | RegExp): RegExpMatchArray | null;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A string to search for.
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
*/
replace(searchValue: string, replaceValue: string): string;
replace(searchValue: string | RegExp, replaceValue: string): string;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A string to search for.
* @param replacer A function that returns the replacement text.
*/
replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags.
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
*/
replace(searchValue: RegExp, replaceValue: string): string;
/**
* Replaces text in a string, using a regular expression or search string.
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
* @param replacer A function that returns the replacement text.
*/
replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string;
replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
/**
* Finds the first substring match in a regular expression search.
* @param regexp The regular expression pattern and applicable flags.
*/
search(regexp: string): number;
/**
* Finds the first substring match in a regular expression search.
* @param regexp The regular expression pattern and applicable flags.
*/
search(regexp: RegExp): number;
search(regexp: string | RegExp): number;
/**
* Returns a section of a string.
@ -386,14 +360,7 @@ interface String {
* @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
* @param limit A value used to limit the number of elements returned in the array.
*/
split(separator: string, limit?: number): string[];
/**
* Split a string into substrings using the specified separator and return them as an array.
* @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
* @param limit A value used to limit the number of elements returned in the array.
*/
split(separator: RegExp, limit?: number): string[];
split(separator: string | RegExp, limit?: number): string[];
/**
* Returns the substring at the specified location within a String object.
@ -861,9 +828,9 @@ interface RegExp {
}
interface RegExpConstructor {
new (pattern: RegExp): RegExp;
new (pattern: RegExp | string): RegExp;
new (pattern: string, flags?: string): RegExp;
(pattern: RegExp): RegExp;
(pattern: RegExp | string): RegExp;
(pattern: string, flags?: string): RegExp;
readonly prototype: RegExp;

View File

@ -4,8 +4,8 @@
(''.match(/ /) || []).map(s => s.toLowerCase());
>(''.match(/ /) || []).map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>''.match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>''.match : Symbol(String.match, Decl(lib.d.ts, --, --))
>match : Symbol(String.match, Decl(lib.d.ts, --, --))
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>s : Symbol(s, Decl(bestChoiceType.ts, 3, 26))
>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
@ -19,8 +19,8 @@ function f1() {
let x = ''.match(/ /);
>x : Symbol(x, Decl(bestChoiceType.ts, 8, 7))
>''.match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>''.match : Symbol(String.match, Decl(lib.d.ts, --, --))
>match : Symbol(String.match, Decl(lib.d.ts, --, --))
let y = x || [];
>y : Symbol(y, Decl(bestChoiceType.ts, 9, 7))
@ -42,8 +42,8 @@ function f2() {
let x = ''.match(/ /);
>x : Symbol(x, Decl(bestChoiceType.ts, 14, 7))
>''.match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>''.match : Symbol(String.match, Decl(lib.d.ts, --, --))
>match : Symbol(String.match, Decl(lib.d.ts, --, --))
let y = x ? x : [];
>y : Symbol(y, Decl(bestChoiceType.ts, 15, 7))

View File

@ -8,9 +8,9 @@
>(''.match(/ /) || []) : RegExpMatchArray
>''.match(/ /) || [] : RegExpMatchArray
>''.match(/ /) : RegExpMatchArray | null
>''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; }
>''.match : (regexp: string | RegExp) => RegExpMatchArray | null
>'' : ""
>match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; }
>match : (regexp: string | RegExp) => RegExpMatchArray | null
>/ / : RegExp
>[] : never[]
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
@ -29,9 +29,9 @@ function f1() {
let x = ''.match(/ /);
>x : RegExpMatchArray | null
>''.match(/ /) : RegExpMatchArray | null
>''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; }
>''.match : (regexp: string | RegExp) => RegExpMatchArray | null
>'' : ""
>match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; }
>match : (regexp: string | RegExp) => RegExpMatchArray | null
>/ / : RegExp
let y = x || [];
@ -60,9 +60,9 @@ function f2() {
let x = ''.match(/ /);
>x : RegExpMatchArray | null
>''.match(/ /) : RegExpMatchArray | null
>''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; }
>''.match : (regexp: string | RegExp) => RegExpMatchArray | null
>'' : ""
>match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; }
>match : (regexp: string | RegExp) => RegExpMatchArray | null
>/ / : RegExp
let y = x ? x : [];

View File

@ -220,15 +220,15 @@ export class HTMLtoJSX {
// wrapping newlines and sequences of two or more spaces in variables.
text = text
>text : Symbol(text, Decl(controlFlowPropertyDeclarations.ts, 113, 7))
>text .replace(/\r/g, '') .replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>text .replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>text .replace(/\r/g, '') .replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>text .replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>text : Symbol(text, Decl(controlFlowPropertyDeclarations.ts, 113, 7))
.replace(/\r/g, '')
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
.replace(/( {2,}|\n|\t|\{|\})/g, function(whitespace) {
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>whitespace : Symbol(whitespace, Decl(controlFlowPropertyDeclarations.ts, 121, 50))
return '{' + JSON.stringify(whitespace) + '}';

View File

@ -295,18 +295,18 @@ export class HTMLtoJSX {
>text = text .replace(/\r/g, '') .replace(/( {2,}|\n|\t|\{|\})/g, function(whitespace) { return '{' + JSON.stringify(whitespace) + '}'; }) : string
>text : string
>text .replace(/\r/g, '') .replace(/( {2,}|\n|\t|\{|\})/g, function(whitespace) { return '{' + JSON.stringify(whitespace) + '}'; }) : string
>text .replace(/\r/g, '') .replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>text .replace(/\r/g, '') .replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>text .replace(/\r/g, '') : string
>text .replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>text .replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>text : string
.replace(/\r/g, '')
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>/\r/g : RegExp
>'' : ""
.replace(/( {2,}|\n|\t|\{|\})/g, function(whitespace) {
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>/( {2,}|\n|\t|\{|\})/g : RegExp
>function(whitespace) { return '{' + JSON.stringify(whitespace) + '}'; } : (whitespace: string) => string
>whitespace : string

View File

@ -8,7 +8,7 @@ regexMatchList.forEach(match => ''.replace(match, ''));
>regexMatchList : Symbol(regexMatchList, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 1, 3))
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>match : Symbol(match, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 2, 23))
>''.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>''.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>match : Symbol(match, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 2, 23))

View File

@ -14,9 +14,9 @@ regexMatchList.forEach(match => ''.replace(match, ''));
>match => ''.replace(match, '') : (this: undefined, match: string) => string
>match : string
>''.replace(match, '') : string
>''.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>''.replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>'' : ""
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>match : string
>'' : ""

View File

@ -14,9 +14,9 @@ module Bugs {
var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) {
>result : Symbol(result, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 7))
>message.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>message.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>message : Symbol(message, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 16))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>match : Symbol(match, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 55))
>rest : Symbol(rest, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 61))

View File

@ -15,9 +15,9 @@ module Bugs {
var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) {
>result : string
>message.replace(/\{(\d+)\}/g, function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; }) : string
>message.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>message.replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>message : string
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>/\{(\d+)\}/g : RegExp
>function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; } : (match: string, ...rest: any[]) => any
>match : string

View File

@ -4,7 +4,7 @@ var a = "Hello";
var b = a.match(/\/ver=([^/]+)/);
>b : Symbol(b, Decl(parser630933.ts, 1, 3))
>a.match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>a.match : Symbol(String.match, Decl(lib.d.ts, --, --))
>a : Symbol(a, Decl(parser630933.ts, 0, 3))
>match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>match : Symbol(String.match, Decl(lib.d.ts, --, --))

View File

@ -6,8 +6,8 @@ var a = "Hello";
var b = a.match(/\/ver=([^/]+)/);
>b : RegExpMatchArray
>a.match(/\/ver=([^/]+)/) : RegExpMatchArray
>a.match : { (regexp: string): RegExpMatchArray; (regexp: RegExp): RegExpMatchArray; }
>a.match : (regexp: string | RegExp) => RegExpMatchArray
>a : string
>match : { (regexp: string): RegExpMatchArray; (regexp: RegExp): RegExpMatchArray; }
>match : (regexp: string | RegExp) => RegExpMatchArray
>/\/ver=([^/]+)/ : RegExp

View File

@ -1,16 +1,16 @@
=== tests/cases/compiler/regExpWithSlashInCharClass.ts ===
var foo1 = "a/".replace(/.[/]/, "");
>foo1 : Symbol(foo1, Decl(regExpWithSlashInCharClass.ts, 0, 3))
>"a/".replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>"a/".replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
var foo2 = "a//".replace(/.[//]/g, "");
>foo2 : Symbol(foo2, Decl(regExpWithSlashInCharClass.ts, 1, 3))
>"a//".replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>"a//".replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
var foo3 = "a/".replace(/.[/no sleep /till/]/, "bugfix");
>foo3 : Symbol(foo3, Decl(regExpWithSlashInCharClass.ts, 2, 3))
>"a/".replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>"a/".replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))

View File

@ -2,27 +2,27 @@
var foo1 = "a/".replace(/.[/]/, "");
>foo1 : string
>"a/".replace(/.[/]/, "") : string
>"a/".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>"a/".replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>"a/" : "a/"
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>/.[/]/ : RegExp
>"" : ""
var foo2 = "a//".replace(/.[//]/g, "");
>foo2 : string
>"a//".replace(/.[//]/g, "") : string
>"a//".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>"a//".replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>"a//" : "a//"
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>/.[//]/g : RegExp
>"" : ""
var foo3 = "a/".replace(/.[/no sleep /till/]/, "bugfix");
>foo3 : string
>"a/".replace(/.[/no sleep /till/]/, "bugfix") : string
>"a/".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>"a/".replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>"a/" : "a/"
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
>/.[/no sleep /till/]/ : RegExp
>"bugfix" : "bugfix"