schnee effeckt und fehler Korektur
This commit is contained in:
12
node_modules/spdx-correct/README.md
generated
vendored
12
node_modules/spdx-correct/README.md
generated
vendored
@@ -1,10 +1,12 @@
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var correct = require('spdx-correct')
|
||||
var assert = require('assert')
|
||||
|
||||
assert.equal(correct('mit'), 'MIT')
|
||||
assert.strictEqual(correct('mit'), 'MIT')
|
||||
|
||||
assert.equal(correct('Apache 2'), 'Apache-2.0')
|
||||
assert.strictEqual(correct('Apache 2'), 'Apache-2.0')
|
||||
|
||||
assert(correct('No idea what license') === null)
|
||||
|
||||
@@ -12,3 +14,9 @@ assert(correct('No idea what license') === null)
|
||||
assert(correct('GPL-3.0'), 'GPL-3.0-or-later')
|
||||
assert(correct('GPL-3.0', { upgrade: false }), 'GPL-3.0')
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
spdx-correct has benefited from the work of several contributors.
|
||||
See [the GitHub repository](https://github.com/jslicense/spdx-correct.js/graphs/contributors)
|
||||
for more information.
|
||||
|
||||
26
node_modules/spdx-correct/index.js
generated
vendored
26
node_modules/spdx-correct/index.js
generated
vendored
@@ -25,6 +25,18 @@ function valid (string) {
|
||||
}
|
||||
}
|
||||
|
||||
// Sorting function that orders the given array of transpositions such
|
||||
// that a transposition with the longer pattern comes before a transposition
|
||||
// with a shorter pattern. This is to prevent e.g. the transposition
|
||||
// ["General Public License", "GPL"] from matching to "Lesser General Public License"
|
||||
// before a longer and more accurate transposition ["Lesser General Public License", "LGPL"]
|
||||
// has a chance to be recognized.
|
||||
function sortTranspositions(a, b) {
|
||||
var length = b[0].length - a[0].length
|
||||
if (length !== 0) return length
|
||||
return a[0].toUpperCase().localeCompare(b[0].toUpperCase())
|
||||
}
|
||||
|
||||
// Common transpositions of license identifier acronyms
|
||||
var transpositions = [
|
||||
['APGL', 'AGPL'],
|
||||
@@ -41,8 +53,17 @@ var transpositions = [
|
||||
['GUN', 'GPL'],
|
||||
['+', ''],
|
||||
['GNU GPL', 'GPL'],
|
||||
['GNU LGPL', 'LGPL'],
|
||||
['GNU/GPL', 'GPL'],
|
||||
['GNU GLP', 'GPL'],
|
||||
['GNU LESSER GENERAL PUBLIC LICENSE', 'LGPL'],
|
||||
['GNU Lesser General Public License', 'LGPL'],
|
||||
['GNU LESSER GENERAL PUBLIC LICENSE', 'LGPL-2.1'],
|
||||
['GNU Lesser General Public License', 'LGPL-2.1'],
|
||||
['LESSER GENERAL PUBLIC LICENSE', 'LGPL'],
|
||||
['Lesser General Public License', 'LGPL'],
|
||||
['LESSER GENERAL PUBLIC LICENSE', 'LGPL-2.1'],
|
||||
['Lesser General Public License', 'LGPL-2.1'],
|
||||
['GNU General Public License', 'GPL'],
|
||||
['Gnu public license', 'GPL'],
|
||||
['GNU Public License', 'GPL'],
|
||||
@@ -51,8 +72,9 @@ var transpositions = [
|
||||
['Mozilla Public License', 'MPL'],
|
||||
['Universal Permissive License', 'UPL'],
|
||||
['WTH', 'WTF'],
|
||||
['WTFGPL', 'WTFPL'],
|
||||
['-License', '']
|
||||
]
|
||||
].sort(sortTranspositions)
|
||||
|
||||
var TRANSPOSED = 0
|
||||
var CORRECT = 1
|
||||
@@ -254,7 +276,7 @@ var lastResorts = [
|
||||
['MPL', 'MPL-2.0'],
|
||||
['X11', 'X11'],
|
||||
['ZLIB', 'Zlib']
|
||||
].concat(licensesWithOneVersion)
|
||||
].concat(licensesWithOneVersion).sort(sortTranspositions)
|
||||
|
||||
var SUBSTRING = 0
|
||||
var IDENTIFIER = 1
|
||||
|
||||
17
node_modules/spdx-correct/package.json
generated
vendored
17
node_modules/spdx-correct/package.json
generated
vendored
@@ -1,24 +1,17 @@
|
||||
{
|
||||
"name": "spdx-correct",
|
||||
"description": "correct invalid SPDX expressions",
|
||||
"version": "3.1.1",
|
||||
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com)",
|
||||
"contributors": [
|
||||
"Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com)",
|
||||
"Christian Zommerfelds <aero_super@yahoo.com>",
|
||||
"Tal Einat <taleinat@gmail.com>",
|
||||
"Dan Butvinik <butvinik@outlook.com>"
|
||||
],
|
||||
"version": "3.2.0",
|
||||
"dependencies": {
|
||||
"spdx-expression-parse": "^3.0.0",
|
||||
"spdx-license-ids": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"defence-cli": "^2.0.1",
|
||||
"defence-cli": "^3.0.1",
|
||||
"replace-require-self": "^1.0.0",
|
||||
"standard": "^11.0.0",
|
||||
"standard-markdown": "^4.0.2",
|
||||
"tape": "^4.9.0"
|
||||
"standard": "^14.3.4",
|
||||
"standard-markdown": "^6.0.0",
|
||||
"tape": "^5.0.1"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
|
||||
Reference in New Issue
Block a user