From 4b56d3a6256c818fa296968abdbde4c392ecff27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 17 Feb 2025 09:41:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E5=88=A4=E6=96=AD=E5=86=85=E5=AE=B9=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E7=9A=84=E5=87=BD=E6=95=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utls.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utls.ts b/src/utls.ts index ee20059..6aad59a 100644 --- a/src/utls.ts +++ b/src/utls.ts @@ -15,6 +15,10 @@ export function defaultEmptyValue(value: T, defaultValue: D): T | D { return value; } +export function isNilOrEmpty(value?: unknown): boolean { + return isNil(value) || isEmpty(value); +} + export function mapToObject(map: Map): Record { const obj = {} as Record; map.forEach((value, key) => {