1
0
mirror of https://github.com/actions/labeler synced 2026-05-08 12:51:03 +02:00
This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

21
node_modules/leven/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,21 @@
declare const leven: {
/**
Measure the difference between two strings.
@example
```
import leven = require('leven');
leven('cat', 'cow');
//=> 2
```
*/
(left: string, right: string): number;
// TODO: Remove this for the next major release, refactor the whole definition to:
// declare function leven(left: string, right: string): number;
// export = leven;
default: typeof leven;
};
export = leven;

92
node_modules/leven/index.js generated vendored
View File

@@ -1,85 +1,77 @@
/* eslint-disable no-nested-ternary */
'use strict';
var arr = [];
var charCodeCache = [];
const array = [];
const charCodeCache = [];
module.exports = function (a, b) {
if (a === b) {
const leven = (left, right) => {
if (left === right) {
return 0;
}
var swap = a;
const swap = left;
// Swapping the strings if `a` is longer than `b` so we know which one is the
// shortest & which one is the longest
if (a.length > b.length) {
a = b;
b = swap;
if (left.length > right.length) {
left = right;
right = swap;
}
var aLen = a.length;
var bLen = b.length;
if (aLen === 0) {
return bLen;
}
if (bLen === 0) {
return aLen;
}
let leftLength = left.length;
let rightLength = right.length;
// Performing suffix trimming:
// We can linearly drop suffix common to both strings since they
// don't increase distance at all
// Note: `~-` is the bitwise way to perform a `- 1` operation
while (aLen > 0 && (a.charCodeAt(~-aLen) === b.charCodeAt(~-bLen))) {
aLen--;
bLen--;
}
if (aLen === 0) {
return bLen;
while (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {
leftLength--;
rightLength--;
}
// Performing prefix trimming
// We can linearly drop prefix common to both strings since they
// don't increase distance at all
var start = 0;
let start = 0;
while (start < aLen && (a.charCodeAt(start) === b.charCodeAt(start))) {
while (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {
start++;
}
aLen -= start;
bLen -= start;
leftLength -= start;
rightLength -= start;
if (aLen === 0) {
return bLen;
if (leftLength === 0) {
return rightLength;
}
var bCharCode;
var ret;
var tmp;
var tmp2;
var i = 0;
var j = 0;
let bCharCode;
let result;
let temp;
let temp2;
let i = 0;
let j = 0;
while (i < aLen) {
charCodeCache[start + i] = a.charCodeAt(start + i);
arr[i] = ++i;
while (i < leftLength) {
charCodeCache[i] = left.charCodeAt(start + i);
array[i] = ++i;
}
while (j < bLen) {
bCharCode = b.charCodeAt(start + j);
tmp = j++;
ret = j;
while (j < rightLength) {
bCharCode = right.charCodeAt(start + j);
temp = j++;
result = j;
for (i = 0; i < aLen; i++) {
tmp2 = bCharCode === charCodeCache[start + i] ? tmp : tmp + 1;
tmp = arr[i];
ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
for (i = 0; i < leftLength; i++) {
temp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;
temp = array[i];
// eslint-disable-next-line no-multi-assign
result = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;
}
}
return ret;
return result;
};
module.exports = leven;
// TODO: Remove this for the next major release
module.exports.default = leven;

20
node_modules/leven/license generated vendored
View File

@@ -1,21 +1,9 @@
The MIT License (MIT)
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

58
node_modules/leven/package.json generated vendored
View File

@@ -1,33 +1,27 @@
{
"_args": [
[
"leven@2.1.0",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "leven@2.1.0",
"_id": "leven@2.1.0",
"_from": "leven@^3.1.0",
"_id": "leven@3.1.0",
"_inBundle": false,
"_integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=",
"_integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==",
"_location": "/leven",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "leven@2.1.0",
"raw": "leven@^3.1.0",
"name": "leven",
"escapedName": "leven",
"rawSpec": "2.1.0",
"rawSpec": "^3.1.0",
"saveSpec": null,
"fetchSpec": "2.1.0"
"fetchSpec": "^3.1.0"
},
"_requiredBy": [
"/jest-validate"
],
"_resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz",
"_spec": "2.1.0",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
"_shasum": "77891de834064cccba82ae7842bb6b14a13ed7f2",
"_spec": "leven@^3.1.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/jest-validate",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@@ -36,25 +30,29 @@
"bugs": {
"url": "https://github.com/sindresorhus/leven/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Measure the difference between two strings using the fastest JS implementation of the Levenshtein distance algorithm",
"devDependencies": {
"ava": "^0.17.0",
"fast-levenshtein": "^2.0.5",
"ava": "^1.4.1",
"fast-levenshtein": "^2.0.6",
"ld": "^0.1.0",
"levdist": "^2.0.0",
"levenshtein": "^1.0.4",
"levenshtein-component": "0.0.1",
"levenshtein-edit-distance": "^2.0.0",
"levdist": "^2.2.9",
"levenshtein": "^1.0.5",
"levenshtein-component": "^0.0.1",
"levenshtein-edit-distance": "^2.0.3",
"matcha": "^0.7.0",
"natural": "^0.4.0",
"talisman": "^0.18.0",
"xo": "^0.16.0"
"natural": "^0.6.3",
"talisman": "^0.21.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"engines": {
"node": ">=0.10.0"
"node": ">=6"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"homepage": "https://github.com/sindresorhus/leven#readme",
"keywords": [
@@ -85,7 +83,7 @@
},
"scripts": {
"bench": "matcha bench.js",
"test": "xo && ava"
"test": "xo && ava && tsd"
},
"version": "2.1.0"
"version": "3.1.0"
}

22
node_modules/leven/readme.md generated vendored
View File

@@ -1,13 +1,13 @@
# leven [![Build Status](https://travis-ci.org/sindresorhus/leven.svg?branch=master)](https://travis-ci.org/sindresorhus/leven)
> Measure the difference between two strings<br>
> The fastest JS implementation of the [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance) algorithm
> One of the fastest JS implementations of the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) algorithm
## Install
```
$ npm install --save leven
$ npm install leven
```
@@ -28,15 +28,15 @@ $ npm run bench
```
```
401,487 op/s » leven
371,707 op/s » talisman
264,191 op/s » levenshtein-edit-distance
152,923 op/s » fast-levenshtein
57,267 op/s » levenshtein-component
19,915 op/s » levdist
21,802 op/s » ld
18,079 op/s » natural
11,761 op/s » levenshtein
165,926 op/s » leven
164,398 op/s » talisman
1,044 op/s » levenshtein-edit-distance
628 op/s » fast-levenshtein
497 op/s » levenshtein-component
195 op/s » ld
190 op/s » levenshtein
168 op/s » levdist
10 op/s » natural
```