Replace versionPathPart with function

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
Josh-Cena 2021-06-18 19:07:59 +08:00
parent 90196bbf47
commit 2dc74ddc3f
No known key found for this signature in database
GPG key ID: C37145B818BDB68F

View file

@ -288,9 +288,13 @@ function createVersionMetadata({
// retro-compatible values // retro-compatible values
const defaultVersionLabel = const defaultVersionLabel =
versionName === CURRENT_VERSION_NAME ? 'Next' : versionName; versionName === CURRENT_VERSION_NAME ? 'Next' : versionName;
const versionNameNotLast = function getDefaultVersionPathPart() {
versionName === CURRENT_VERSION_NAME ? 'next' : versionName; if (isLast) {
const defaultVersionPathPart = isLast ? '' : versionNameNotLast; return '';
}
return versionName === CURRENT_VERSION_NAME ? 'next' : versionName;
}
const defaultVersionPathPart = getDefaultVersionPathPart();
const versionOptions: VersionOptions = options.versions[versionName] ?? {}; const versionOptions: VersionOptions = options.versions[versionName] ?? {};