index.js
function getJsonLicense (json) {
  var license = 'nomatch'
  if (typeof json === 'string') {
    license = matchLicense(json) || 'nomatch'
  } else {
    if (json.url) {
      license = { name: json.type, url: json.url }
    } else {
      license = matchLicense(json.type)
    }
  }
  return license
}
function getJsonLicense (json) {
  var license = 'nomatch'
  if (typeof json === 'string') {
    license = matchLicense(json) || 'nomatch'
  } else {
    if (json.url) {
      license = { name: json.type, url: json.url }
    } else {
      license = matchLicense(json.type)
    }
  }
  return license
}
function getJsonLicense ( json ) { var license = 'nomatch' if ( typeof json === 'string' ) { license = matchLicense ( json ) || 'nomatch' } else { if ( json . url ) { license = { name : json . type , url : json . url } } else { license = matchLicense ( json . type ) } } return license }
Convert package.json format to a known license. If a developer specifies just the name, we check it against SPDX, according to NPM guidelines. If they supply a URL, we just link to it, preserving name and exact link.
Convert package . json format to a known license . If a developer specifies just the name we check it against SPDX according to NPM guidelines . If they supply a URL we just link to it preserving name and exact link .