Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "OTHER" to license list #8

Merged
merged 3 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const spdxExpressionParse = require('spdx-expression-parse')
const spdxSatisfies = require('spdx-satisfies')
const spdxLicenseList = require('spdx-license-list')
const spdxLicenseSet = require('spdx-license-list/simple')
spdxLicenseSet.add('OTHER') // OTHER is a valid license in Clearly Defined, not found in SPDX

const lowerSpdxLicenseMap = new Map(Array.from(spdxLicenseSet).map(x => [x.toLowerCase(), x]))
const lowerSpdxNameMap = new Map(Object.keys(spdxLicenseList).map(x => [spdxLicenseList[x].name.toLowerCase(), x]))
const { isEqual, sortBy, union, uniqWith } = require('lodash')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clearlydefined/spdx",
"version": "0.1.1",
"version": "0.1.2",
"description": "SPDX custom libraries of clearlydefined.io.",
"license": "MIT",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('SPDX utility functions', () => {
['mit', { license: 'MIT' }],
['MIT ', { license: 'MIT' }],
[' MIT', { license: 'MIT' }],
['Other', { license: 'OTHER' }],
['MIT OR Apache-2.0', { left: { license: 'MIT' }, conjunction: 'or', right: { license: 'Apache-2.0' } }],
['MIT AND Apache-2.0', { left: { license: 'MIT' }, conjunction: 'and', right: { license: 'Apache-2.0' } }],
[
Expand Down Expand Up @@ -201,6 +202,8 @@ describe('SPDX utility functions', () => {
'MIT ': 'MIT',
' MIT': 'MIT',
'GPL-1.0+': 'GPL-1.0+',
'OTHER': 'OTHER',
'other': 'OTHER',
'Apache-2.0 WITH commons-clause': 'NOASSERTION',
'NOASSERTION': 'NOASSERTION',
'See license': 'NOASSERTION',
Expand Down