1
0
mirror of synced 2025-12-22 03:16:52 -05:00

remove helper from this branch (to be re-added in child branch for easier reviewing)

This commit is contained in:
Sarah Schneider
2021-01-14 12:07:49 -05:00
parent 79a7a7972f
commit b6032f285c
8 changed files with 9 additions and 30 deletions

View File

@@ -1,14 +0,0 @@
const slash = require('slash')
const patterns = require('./patterns')
const nonEnterpriseDefaultVersion = require('./non-enterprise-default-version')
// This is a convenience function to remove free-pro-team@latest from all
// **user-facing** aspects of the site (particularly URLs) while continuing to support
// free-pro-team@latest as a version both in the codebase and in content/data files.
module.exports = function removeFPTFromPath (path) {
path = process.env.FEATURE_REMOVE_FPT
? slash(path.replace(`/${nonEnterpriseDefaultVersion}`, ''))
: path
return path.replace(patterns.trailingSlash, '$1')
}