From 3418e3e86771b0aa5616f4b2640263897de471ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=BB=E8=BD=AC=E5=B2=A9=E7=9F=B3=2C=E6=99=A8=E5=85=89?= =?UTF-8?q?=E6=B4=92=E8=90=BD=E6=88=91=E8=BA=AB?= <114394519+homocat@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:41:43 +0800 Subject: [PATCH] feat(typed): isMap Function --- src/typed.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/typed.ts b/src/typed.ts index e6600171..8aef2614 100644 --- a/src/typed.ts +++ b/src/typed.ts @@ -52,6 +52,10 @@ export const isDate = (value: any): value is Date => { return Object.prototype.toString.call(value) === '[object Date]' } +export const isMap = (value: any): value is Map => { + return Object.prototype.toString.call(value) === '[object Map]' +} + /** * This is really a _best guess_ promise checking. You * should probably use Promise.resolve(value) to be 100%