File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ const allProducts = require('./all-products')
66const allVersions = require ( './all-versions' )
77const { getNewVersionedPath } = require ( './old-versions-utils' )
88
9+ const supportedVersions = new Set ( Object . keys ( allVersions ) )
10+
911// construct appropriate versioned path for any given HREF
1012function getVersionedPathWithoutLanguage ( href , version ) {
1113 // start clean without language code or trailing slash
@@ -24,7 +26,7 @@ function getVersionedPathWithoutLanguage (href, version) {
2426
2527 // if the version found is not a currently supported version...
2628 let productObjectFromPath
27- if ( ! Object . keys ( allVersions ) . includes ( versionFromPath ) ) {
29+ if ( ! supportedVersions . has ( versionFromPath ) ) {
2830 // first check if the first segment is instead a current product;
2931 // example: /admin/foo or /desktop/foo
3032 productObjectFromPath = allProducts [ versionFromPath ]
You can’t perform that action at this time.
0 commit comments