mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-21 10:37:51 +02:00
refactor(content-docs): move isCategoriesShorthand to utils (#5962)
This commit is contained in:
parent
ac1df888ae
commit
2f7d6fea1e
18 changed files with 39 additions and 29 deletions
|
@ -13,10 +13,18 @@ import type {
|
|||
SidebarItemLink,
|
||||
SidebarItemDoc,
|
||||
SidebarItemType,
|
||||
SidebarCategoriesShorthand,
|
||||
SidebarItemConfig,
|
||||
} from './types';
|
||||
import {mapValues, difference} from 'lodash';
|
||||
import {getElementsAround, toMessageRelativeFilePath} from '@docusaurus/utils';
|
||||
|
||||
export function isCategoriesShorthand(
|
||||
item: SidebarItemConfig,
|
||||
): item is SidebarCategoriesShorthand {
|
||||
return typeof item !== 'string' && !item.type;
|
||||
}
|
||||
|
||||
export function transformSidebarItems(
|
||||
sidebar: Sidebar,
|
||||
updateFn: (item: SidebarItem) => SidebarItem,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue