fix typing

This commit is contained in:
Norbert de Langen 2023-03-02 16:59:12 +01:00
parent 9e07394ca8
commit 39102d3b83
No known key found for this signature in database
GPG Key ID: FD0E78AF9A837762

View File

@ -140,7 +140,7 @@ export const transformStoryIndexToStoriesHash = (
// First, split the title into a set of names, separated by '/' and trimmed.
// @ts-expect-error (this is to support stories.json v2)
const title = item.title || item.kind;
const title: string = item.title || item.kind;
const groups = title.trim().split(TITLE_PATH_SEPARATOR);
const root = (!setShowRoots || showRoots) && groups.length > 1 ? [groups.shift()] : [];
const names = [...root, ...groups];