Skip to content

Commit 9e6b194

Browse files
refactor(generic-includer): extract shared result object for index entry
1 parent dca0977 commit 9e6b194

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/extensions/generic-includer/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,18 @@ function fillToc(toc: RawToc, graph: Graph, options: Options) {
127127
if (indexHref) {
128128
const useIndexHeading =
129129
options.linkIndexAutotitle === true && options.autotitle !== false;
130+
const result = {
131+
href: indexHref,
132+
items: childEntries.map(item),
133+
};
130134

131135
if (useIndexHeading) {
132-
return {
133-
href: indexHref,
134-
items: childEntries.map(item),
135-
};
136+
return result;
136137
}
137138

138139
return {
139140
name: key as YfmString,
140-
href: indexHref,
141-
items: childEntries.map(item),
141+
...result,
142142
};
143143
}
144144

0 commit comments

Comments
 (0)