Updated getRegExpMatch error message

This commit is contained in:
sanex3339
2020-01-13 00:32:53 +03:00
parent e404b1d520
commit 3bf270e8b9
+1 -1
View File
@@ -8,7 +8,7 @@ export function getRegExpMatch (str: string, regExp: RegExp, matchIndex: number
const match: RegExpMatchArray | null = str.match(regExp);
if (!match) {
throw new Error(`No matches were found for regular expression \`${regExp.toString()}\``);
throw new Error(`No matches were found. String: \`${str}\`, regular expression: \`${regExp.toString()}\``);
}
return (<RegExpMatchArray>match)[matchIndex + 1];