jslicense / spdx-satisfies.js

test whether SPDX expressions satisfy licensing criteria

Home Page:https://www.npmjs.com/package/spdx-satisfies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spdx-satisfies crashes for some license identifiers

jinwoo opened this issue · comments

I found a few spdx license identifiers that make spdx-satisfies crash: TCP-wrappers, Unicode-DFS-2015, Unicode-DFS-2016. They are all valid IDs both in https://spdx.org/licenses/ and https://github.com/shinnn/spdx-license-ids/blob/master/index.json.

> const spdxSatisfies = require('spdx-satisfies');
> spdxSatisfies('MIT', 'MIT');
true
> spdxSatisfies('TCP-wrappers', 'TCP-wrappers');
TypeError: Function.prototype.toString requires that 'this' be a Function
    at _parseError.toString (<anonymous>)
    at String (<anonymous>)
    at Domain.debugDomainError (repl.js:306:41)
    at Domain.emit (events.js:159:13)
    at REPLServer.defaultEval (repl.js:268:26)
    at bound (domain.js:370:14)
    at REPLServer.runBound [as eval] (domain.js:383:12)
    at REPLServer.onLine (repl.js:493:10)
    at REPLServer.emit (events.js:164:20)
    at REPLServer.Interface._onLine (readline.js:287:10)

The same for Unicode-DFS-2015, Unicode-DFS-2016. I'm not sure there are more such IDs.