How to use the spdx-license-ids.concat function in spdx-license-ids

To help you get started, we’ve selected a few spdx-license-ids examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jslicense / spdx-expression-parse.js / generate-parser.js View on Github external
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)]
  })
}

spdx-license-ids

A list of SPDX license identifiers

CC0-1.0
Latest version published 3 months ago

Package Health Score

75 / 100
Full package analysis