Skip to content

Commit

Permalink
Refactor away from template literal
Browse files Browse the repository at this point in the history
ES6 is pretty old now, but we try to support old Node.js versions.
  • Loading branch information
kemitchell committed Sep 21, 2023
1 parent 05cb55d commit be77eb4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ function endsWith (string, substring) {

function licenseString (e) {
if (e.hasOwnProperty('noassertion')) return 'NOASSERTION'
if (e.license) return `${e.license}${e.plus ? '+' : ''}${e.exception ? ` WITH ${e.exception}` : ''}`
if (e.license) {
return (
e.license +
(e.plus ? '+' : '') +
(e.exception ? ('WITH ' + e.exception) : '')
)
}
}

// Expand the given expression into an equivalent array where each member is an array of licenses AND'd
Expand Down

0 comments on commit be77eb4

Please sign in to comment.