File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ export function isBigUInt64Array(value: unknown): value is BigUint64Array {
3535 ) ;
3636}
3737
38- export function isRegExp ( d : unknown ) : d is RegExp {
39- return Object . prototype . toString . call ( d ) === '[object RegExp]' ;
38+ export function isRegExp ( regexp : unknown ) : regexp is RegExp {
39+ return regexp instanceof RegExp || Object . prototype . toString . call ( regexp ) === '[object RegExp]' ;
4040}
4141
4242export function isMap ( value : unknown ) : value is Map < unknown , unknown > {
@@ -48,8 +48,8 @@ export function isMap(value: unknown): value is Map<unknown, unknown> {
4848 ) ;
4949}
5050
51- export function isDate ( d : unknown ) : d is Date {
52- return Object . prototype . toString . call ( d ) === '[object Date]' ;
51+ export function isDate ( date : unknown ) : date is Date {
52+ return date instanceof Date || Object . prototype . toString . call ( date ) === '[object Date]' ;
5353}
5454
5555export type InspectFn = ( x : unknown , options ?: unknown ) => string ;
You can’t perform that action at this time.
0 commit comments