MCPcopy Index your code
hub / github.com/github/docs / splitVersion

Function splitVersion

lib/render-content/liquid.js:14–30  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

12// e.g., free-pro-team@latest, where free-pro-team is the plan and latest is the release
13// in addition to legacy formats where the version passed is simply 2.21
14function splitVersion(version) {
15 // The default plan when working with versions is "enterprise-server".
16 // Default to that value here to support backward compatibility from before
17 // plans were explicitly included.
18 let plan = 'enterprise-server'
19 let release
20
21 const lastIndex = version.lastIndexOf('@')
22 if (lastIndex === -1) {
23 release = version
24 } else {
25 plan = version.slice(0, lastIndex)
26 release = version.slice(lastIndex + 1)
27 }
28
29 return [plan, release]
30}
31
32const engine = new Liquid({
33 root: path.join(process.cwd(), 'includes'),

Callers 1

liquid.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected