How to use the spdx-license-ids.indexOf 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 OpenUserJS / OpenUserJS.org / controllers / scriptStorage.js View on Github external
aInnerCallback(new statusError({
          message: '`@license` must match in UserScript and UserLibrary metadata blocks.',
          code: 400
        }), null);
        return;
      }

      if (!isLib) {
        userKeyset = masterKeyset;
      } else {
        userKeyset = slaveKeyset;
      }

      if (userKeyset) {
        thatSPDX = userKeyset[userKeyset.length - 1].split('; ')[0];
        if (SPDX.indexOf(thatSPDX) === -1 || blockSPDX.indexOf(thatSPDX) > -1) {
          // No valid OSI primary e.g. last key... reject
          aInnerCallback(new statusError({
            message: '`@license` is not OSI primary and compatible in the metadata block(s).',
            code: 400
          }), null);
          return;
        }

        for (i = 0; userKey = userKeyset[i++];) {
          thisKeyComponents = userKey.split('; ');
          if (thisKeyComponents.length > 2) {
            // Too many parts... reject
            aInnerCallback(new statusError({
              message: '`@license` has too many parts in the metadata block(s).',
              code: 400
            }), null);
github jslicense / spdx-expression-parse.js / scanner.js View on Github external
function tokenTypeForString (string, start) {
  if (ids.indexOf(string) !== -1) {
    return 'LICENSE'
  } else if (string === 'AND') {
    return 'AND'
  } else if (string === 'OR') {
    return 'OR'
  } else if (string === 'WITH') {
    return 'WITH'
  } else if (exceptions.indexOf(string) !== -1) {
    return 'EXCEPTION'
  } else if (LICENSEREF.test(string)) {
    return 'LICENSEREF'
  } else if (DOCUMENTREF.test(string)) {
    return 'DOCUMENTREF'
  } else if (string === '(') {
    return 'OPEN'
  } else if (string === ')') {
github devinhalladay / devinhalladay.com / node_modules / spdx-correct / index.js View on Github external
function valid(string) {
  return licenseIDs.indexOf(string) > -1;
}

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