mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 13:38:33 +02:00
32 lines
742 B
TypeScript
32 lines
742 B
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
import type {
|
|
DocMetadata,
|
|
GlobalDoc,
|
|
LoadedVersion,
|
|
GlobalVersion,
|
|
} from './types';
|
|
|
|
export function toGlobalDataDoc(doc: DocMetadata): GlobalDoc {
|
|
return {
|
|
id: doc.unversionedId,
|
|
path: doc.permalink,
|
|
sidebar: doc.sidebar,
|
|
};
|
|
}
|
|
|
|
export function toGlobalDataVersion(version: LoadedVersion): GlobalVersion {
|
|
return {
|
|
name: version.versionName,
|
|
label: version.versionLabel,
|
|
isLast: version.isLast,
|
|
path: version.versionPath,
|
|
mainDocId: version.mainDocId,
|
|
docs: version.docs.map(toGlobalDataDoc),
|
|
};
|
|
}
|