Add RegExp check to allow class extension

Co-Authored-By: Joel Einbinder <joel.einbinder@gmail.com>
This commit is contained in:
aesyondu 2020-02-25 09:25:23 +08:00 committed by GitHub
parent 49da4cc4f6
commit cccdd52751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,7 +99,7 @@ class Helper {
}
static isRegExp(obj: any): obj is RegExp {
return Object.prototype.toString.call(obj) === '[object RegExp]';
return obj instanceof RegExp || Object.prototype.toString.call(obj) === '[object RegExp]';
}
static async waitForEvent(