Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit d2efe17

Browse files
Merge pull request #5 from deckgo/build/fix-dash-slots-docs
build: fix slots with dash as component name
2 parents 61b8d09 + b25d48b commit d2efe17

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

deckdeckgo.desc.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ const parseSlots = (slots: JsonDocsSlot[] | undefined): DeckDeckGoSlot[] | undef
2828

2929
return slots.map((slot: JsonDocsSlot) => {
3030
const docs: string[] | undefined = slot.docs?.split('-');
31-
const types: string[] | undefined = docs && docs.length >= 2 ? docs[1]?.trim().split(',') : undefined;
31+
32+
const [, ...elements] = docs;
33+
const types: string[] | undefined = elements
34+
.join('-')
35+
.trim()
36+
.split(',')
37+
.filter((element: string) => element !== '');
3238

3339
return {
3440
name: slot.name,

0 commit comments

Comments
 (0)