From 529b8470e516b79c0cdeb17c4a29458b72c1c78c Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 13 Nov 2019 18:06:12 +0800 Subject: [PATCH] Core: Fix showRoots behavior when there's no hierarchy --- lib/api/src/modules/stories.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/src/modules/stories.ts b/lib/api/src/modules/stories.ts index c7257faa11d..04347c168f8 100644 --- a/lib/api/src/modules/stories.ts +++ b/lib/api/src/modules/stories.ts @@ -243,7 +243,7 @@ const initStoriesApi = ({ // 3. If the user passes showRoots, or doesn't match above, do a simpler splitting. } else { const parts: string[] = kind.split('/'); - if (showRoots) { + if (showRoots && parts.length > 1) { [root, ...groups] = parts; } else { groups = parts;