-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlicenses.ts
More file actions
50 lines (48 loc) · 1.29 KB
/
Copy pathlicenses.ts
File metadata and controls
50 lines (48 loc) · 1.29 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* @file License identifier constants. Exports common SPDX license strings (MIT,
* UNLICENSED) and a lazily-built set of copy-left SPDX identifiers used when
* classifying package licenses.
*/
import { SetCtor } from '../primordials/map-set'
// License identifiers.
export const MIT = 'MIT'
export const UNLICENCED = 'UNLICENCED'
export const UNLICENSED = 'UNLICENSED'
// Copy-left licenses.
let copyLeftLicenses: Set<string>
/**
* Get the set of SPDX identifiers considered copy-left (AGPL, GPL, EPL, EUPL,
* CC-BY-SA variants). The set is lazily built and cached on first call.
*
* @returns A `Set` of SPDX license identifier strings.
*/
export function getCopyLeftLicenses(): Set<string> {
if (copyLeftLicenses === undefined) {
copyLeftLicenses = new SetCtor([
'AGPL-1.0',
'AGPL-1.0-only',
'AGPL-1.0-or-later',
'AGPL-3.0',
'AGPL-3.0-only',
'AGPL-3.0-or-later',
'CC-BY-SA-1.0',
'CC-BY-SA-2.0',
'CC-BY-SA-3.0',
'CC-BY-SA-4.0',
'EPL-1.0',
'EPL-2.0',
'EUPL-1.1',
'EUPL-1.2',
'GPL-1.0',
'GPL-1.0-only',
'GPL-1.0-or-later',
'GPL-2.0',
'GPL-2.0-only',
'GPL-2.0-or-later',
'GPL-3.0',
'GPL-3.0-only',
'GPL-3.0-or-later',
])
}
return copyLeftLicenses
}