spdx-satisfies 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/index.js +4 -4
  3. package/package.json +4 -1
package/README.md CHANGED
@@ -14,6 +14,10 @@ assert(satisfies('GPL-1.0+', 'GPL-2.0+'))
14
14
  assert(!satisfies('GPL-1.0', 'GPL-2.0+'))
15
15
  assert(satisfies('GPL-2.0-only', 'GPL-2.0-only'))
16
16
  assert(satisfies('GPL-3.0-only', 'GPL-2.0+'))
17
+ assert(satisfies('LGPL-3.0-only', 'LGPL-3.0-or-later'))
18
+ assert(satisfies('GPL-2.0', 'GPL-2.0+'))
19
+ assert(satisfies('GPL-2.0-only', 'GPL-2.0+'))
20
+ assert(satisfies('GPL-2.0', 'GPL-2.0-or-later'))
17
21
 
18
22
  assert(!satisfies(
19
23
  'GPL-2.0',
package/index.js CHANGED
@@ -76,7 +76,7 @@ function normalizeGPLIdentifiers (argument) {
76
76
  }
77
77
 
78
78
  function endsWith (string, substring) {
79
- return string.indexOf(substring) === string.length - 1
79
+ return string.indexOf(substring) === string.length - substring.length
80
80
  }
81
81
 
82
82
  function licenseString (e) {
@@ -89,13 +89,13 @@ function licenseString (e) {
89
89
  // `[[GPL-3.0 AND MIT], [ISC AND MIT]]`. Note that within each array of licenses, the entries are
90
90
  // normalized (sorted) by license name.
91
91
  function expand (expression) {
92
- return sort(Array.from(expandInner(expression)))
92
+ return sort(expandInner(expression))
93
93
  }
94
94
 
95
95
  // Flatten the given expression into an array of all licenses mentioned in the expression.
96
96
  function flatten (expression) {
97
- const expanded = Array.from(expandInner(expression))
98
- const flattened = expanded.reduce(function (result, clause) {
97
+ var expanded = expandInner(expression)
98
+ var flattened = expanded.reduce(function (result, clause) {
99
99
  return Object.assign(result, clause)
100
100
  }, {})
101
101
  return sort([flattened])[0]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "spdx-satisfies",
3
3
  "description": "test whether SPDX expressions satisfy licensing criteria",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "author": "Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com)",
6
6
  "contributors": [
7
7
  "Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com)",
@@ -30,6 +30,9 @@
30
30
  ],
31
31
  "license": "MIT",
32
32
  "repository": "kemitchell/spdx-satisfies.js",
33
+ "files": [
34
+ "index.js"
35
+ ],
33
36
  "scripts": {
34
37
  "test": "defence -i javascript README.md | replace-require-self | node",
35
38
  "lint": "standard"