Skip to content

Commit

Permalink
Merge pull request #8 from disulliv/other
Browse files Browse the repository at this point in the history
Add "OTHER" to license list
  • Loading branch information
nellshamrell authored Mar 17, 2021
2 parents b7c4253 + 91bd6d7 commit fa5e7e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
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

0 comments on commit fa5e7e0

Please sign in to comment.