diff --git a/index.js b/index.js index 0e709c5..de48248 100644 --- a/index.js +++ b/index.js @@ -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') diff --git a/package.json b/package.json index 3521b4a..aaa7183 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test.js b/test.js index b4a236d..f5bf725 100644 --- a/test.js +++ b/test.js @@ -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' } }], [ @@ -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',