Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

remove-deprecated-frontmatter.js 1.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  1. const { getEnterpriseServerNumber } = require('./patterns')
  2. module.exports = function removeDeprecatedFrontmatter (file, frontmatterVersions, versionToDeprecate, nextOldestVersion) {
  3. // skip files with no versions or Enterprise Server versions frontmatter
  4. if (!frontmatterVersions) return
  5. if (!frontmatterVersions['enterprise-server']) return
  6. const enterpriseRange = frontmatterVersions['enterprise-server']
  7. // skip files with versions frontmatter that applies to all enterprise-server releases
  8. if (enterpriseRange === '*') return
  9. // get the release numbers alone
  10. const releaseToDeprecate = versionToDeprecate.match(getEnterpriseServerNumber)[1]
  11. const nextOldestRelease = nextOldestVersion.match(getEnterpriseServerNumber)[1]
  12. // if the release to deprecate is 2.13, and the FM is either '>=2.13' or '>=2.14',
  13. // we can safely change the FM to enterprise-server: '*'
  14. if (enterpriseRange === `>=${releaseToDeprecate}` || enterpriseRange === `>=${nextOldestRelease}`) {
  15. frontmatterVersions['enterprise-server'] = '*'
  16. }
  17. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...