]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(shared): improve isDate check (#5803)
authorVanilla <85759660+skyemoe@users.noreply.github.com>
Fri, 13 May 2022 08:17:31 +0000 (16:17 +0800)
committerGitHub <noreply@github.com>
Fri, 13 May 2022 08:17:31 +0000 (04:17 -0400)
packages/shared/src/index.ts

index 63aa9a37c2aa61f60ccf9afb9cec94af9fb3536d..f3fee4c45e7be83b52fac3818b4e04e1a6299948 100644 (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'