fix(shared): improve isDate check (#5803)

This commit is contained in:
Vanilla 2022-05-13 16:17:31 +08:00 committed by GitHub
parent 4d7803ed28
commit eef14471b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@ export const isMap = (val: unknown): val is Map<any, any> =>
export const isSet = (val: unknown): val is Set<any> =>
toTypeString(val) === '[object Set]'
export const isDate = (val: unknown): val is Date => val instanceof Date
export const isDate = (val: unknown): val is Date => toTypeString(val) === '[object Date]'
export const isFunction = (val: unknown): val is Function =>
typeof val === 'function'
export const isString = (val: unknown): val is string => typeof val === 'string'