2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-28 13:09:07 +00:00

chore: simplify licenses list in utils

This commit is contained in:
Vjacheslav Trushkin 2024-04-15 17:46:04 +03:00
parent a210a25367
commit 4bd7fd5d75

View File

@ -9,85 +9,66 @@ export interface LicenseInfo {
sameLicense?: boolean;
}
// Completely free, no limits
const freeLicense: LicenseInfo = {
attribution: false,
commercial: true,
};
// Requires same license for derived works
const freeSameLicense: LicenseInfo = {
attribution: false,
commercial: true,
sameLicense: true,
};
// Requires attribution
const attribLicense: LicenseInfo = {
attribution: true,
commercial: true,
};
// Requires attribution and same license for derived works
const attribSameLicense: LicenseInfo = {
attribution: true,
commercial: true,
sameLicense: true,
};
// Requires attribution and non-commercial use
const attribNonCommercialLicense: LicenseInfo = {
attribution: true,
commercial: false,
};
// Requires attribution, non-commercial use and same license for derived works
const attribNonCommercialSameLicense: LicenseInfo = {
attribution: true,
commercial: false,
sameLicense: true,
};
/**
* Data for open source licenses used by icon sets in `@iconify/json` package and smaller packages
*
* Key is SPDX license identifier
*/
export const licensesData: Record<string, LicenseInfo> = {
'Apache-2.0': {
attribution: false,
commercial: true,
},
'MIT': {
attribution: false,
commercial: true,
},
'CC0-1.0': {
attribution: false,
commercial: true,
},
'MPL-2.0': {
attribution: false,
commercial: true,
},
'CC-BY-3.0': {
attribution: true,
commercial: true,
},
'CC-BY-SA-3.0': {
attribution: true,
commercial: true,
sameLicense: true,
},
'CC-BY-4.0': {
attribution: true,
commercial: true,
},
'CC-BY-SA-4.0': {
attribution: true,
commercial: true,
sameLicense: true,
},
'CC-BY-NC-4.0': {
attribution: true,
commercial: false,
},
'CC-BY-NC-SA-4.0': {
attribution: true,
commercial: false,
sameLicense: true,
},
'ISC': {
attribution: false,
commercial: true,
},
'OFL-1.1': {
attribution: false,
commercial: true,
},
'GPL-2.0-only': {
attribution: false,
commercial: true,
sameLicense: true,
},
'GPL-2.0-or-later': {
attribution: false,
commercial: true,
sameLicense: true,
},
'GPL-3.0': {
attribution: false,
commercial: true,
sameLicense: true,
},
'GPL-3.0-or-later': {
attribution: false,
commercial: true,
sameLicense: true,
},
'Unlicense': {
attribution: false,
commercial: true,
},
'Apache-2.0': freeLicense,
'MIT': freeLicense,
'MPL-2.0': freeLicense,
'CC0-1.0': freeLicense,
'CC-BY-3.0': attribLicense,
'CC-BY-SA-3.0': attribSameLicense,
'CC-BY-4.0': attribLicense,
'CC-BY-SA-4.0': attribSameLicense,
'CC-BY-NC-4.0': attribNonCommercialLicense,
'CC-BY-NC-SA-4.0': attribNonCommercialSameLicense,
'ISC': freeLicense,
'OFL-1.1': freeLicense,
'GPL-2.0-only': freeSameLicense,
'GPL-2.0-or-later': freeSameLicense,
'GPL-3.0': freeSameLicense,
'GPL-3.0-or-later': freeSameLicense,
'Unlicense': freeLicense,
};