-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathconstant.js
More file actions
34 lines (29 loc) · 833 Bytes
/
constant.js
File metadata and controls
34 lines (29 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { getNvmSystemVersion } from './nvm.js'
// Resolve aliases whose name is a constant and is not LTS-related
export const getConstantAlias = (alias) => {
const versionRange = ALIASES[alias]
if (versionRange === undefined) {
return
}
if (typeof versionRange !== 'function') {
return versionRange
}
return versionRange()
}
const ALIASES = {
// Latest version (nave, nvm-windows, n, nvs, nodebrew, nodist, fish-nvm)
latest: '*',
// Latest version (nvm, nave, nodebrew)
stable: '*',
// Latest version (nvm)
node: '*',
// Latest version (n, fish-nvm)
current: '*',
// Version if nvm was not installed
system: getNvmSystemVersion,
// Alias from nvm. Now that iojs is merged to Node.js, it is always this
// version.
iojs: '4.0.0',
// Old deprecated nvm alias
unstable: '0.11',
}