From 1e69bc221d9f7d9379b3103b1931d08977bea472 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Tue, 19 May 2026 16:25:42 +0800 Subject: [PATCH] =?UTF-8?q?refactor(utils):=20=E6=94=BE=E5=AE=BD=20isPop/i?= =?UTF-8?q?sPage/isPageFragment=20=E5=85=A5=E5=8F=82=E4=B8=BA=E4=BB=85?= =?UTF-8?q?=E9=9C=80=20type=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- packages/utils/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index c32736e9..e49337e5 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -262,14 +262,15 @@ export const delQueStr = (url: string, ref: string[] | string) => { export const isObject = (obj: any) => Object.prototype.toString.call(obj) === '[object Object]'; -export const isPop = (node: MComponent | null): boolean => Boolean(node?.type?.toLowerCase().endsWith('pop')); +export const isPop = (node: Pick | null): boolean => + Boolean(node?.type?.toLowerCase().endsWith('pop')); -export const isPage = (node?: MComponent | null): boolean => { +export const isPage = (node?: Pick | null): boolean => { if (!node) return false; return Boolean(node.type?.toLowerCase() === NodeType.PAGE); }; -export const isPageFragment = (node?: MComponent | null): boolean => { +export const isPageFragment = (node?: Pick | null): boolean => { if (!node) return false; return Boolean(node.type?.toLowerCase() === NodeType.PAGE_FRAGMENT); };