Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var handleLicensesAndExceptions = function () {
var ids = require('spdx-license-ids')
var exceptions = require('spdx-exceptions')
// Sort tokens longest-first (both license ids and exception strings)
var tokens = ids.concat(exceptions)
tokens.sort(function (a, b) { return b.length - a.length })
return tokens.map(function (t) {
var type = (ids.indexOf(t) >= 0) ? 'LICENSE' : 'EXCEPTION'
return [regexEscape(t), 'return ' + quote(type)]
})
}