minor refactor

This commit is contained in:
sebastien 2025-10-30 16:44:00 +01:00
parent 927b0c7b39
commit b80ee31401

View File

@ -116,14 +116,14 @@ export async function readLastUpdateData(
filePath: string,
options: LastUpdateOptions,
lastUpdateFrontMatter: FrontMatterLastUpdate | undefined,
vcs: Pick<VcsConfig, 'getFileLastUpdateInfo'>,
vcsParam: Pick<VcsConfig, 'getFileLastUpdateInfo'>,
): Promise<LastUpdateData> {
// We fallback to the default VSC config at runtime on purpose
// It preserves retro-compatibility if a third-party plugin imports it
// This also ensures unit tests keep working without extra setup
// We still want to ensure type safety by requiring the VCS param
// TODO Docusaurus v4: refactor all these Git read APIs
vcs = vcs ?? DEFAULT_VCS_CONFIG;
const vcs = vcsParam ?? DEFAULT_VCS_CONFIG;
const {showLastUpdateAuthor, showLastUpdateTime} = options;