From d76704170b0ec11b5cf82527f2c8fc5d0ca076de Mon Sep 17 00:00:00 2001 From: turtle1999 Date: Thu, 10 Sep 2026 15:24:27 +0800 Subject: [PATCH] refactor(home-paths): simplify cache path dispatch --- packages/util/home-paths/src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/util/home-paths/src/index.ts b/packages/util/home-paths/src/index.ts index 02a479fb89..0d7b934003 100644 --- a/packages/util/home-paths/src/index.ts +++ b/packages/util/home-paths/src/index.ts @@ -106,9 +106,8 @@ export function dshHomePath(...segments: string[]): string { * @returns the normalized absolute cache path. */ export function dshCachePath(optionsOrSegment: { dshHome?: string } | string = {}, ...segments: string[]): string { - const configured = typeof optionsOrSegment === 'string' ? undefined : optionsOrSegment.dshHome - const children = typeof optionsOrSegment === 'string' ? [optionsOrSegment, ...segments] : segments - return join(resolveDshHome(configured), 'cache', ...children) + if (typeof optionsOrSegment === 'string') return dshHomePath('cache', optionsOrSegment, ...segments) + return join(resolveDshHome(optionsOrSegment.dshHome), 'cache', ...segments) } /**