mirror of
				https://gitea.com/actions/setup-python.git
				synced 2025-10-29 07:47:14 +00:00 
			
		
		
		
	Initial pass
This commit is contained in:
		
							
								
								
									
										85
									
								
								node_modules/leven/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								node_modules/leven/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,85 @@ | ||||
| /* eslint-disable no-nested-ternary */ | ||||
| 'use strict'; | ||||
| var arr = []; | ||||
| var charCodeCache = []; | ||||
|  | ||||
| module.exports = function (a, b) { | ||||
| 	if (a === b) { | ||||
| 		return 0; | ||||
| 	} | ||||
|  | ||||
| 	var swap = a; | ||||
|  | ||||
| 	// 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; | ||||
| 	} | ||||
|  | ||||
| 	var aLen = a.length; | ||||
| 	var bLen = b.length; | ||||
|  | ||||
| 	if (aLen === 0) { | ||||
| 		return bLen; | ||||
| 	} | ||||
|  | ||||
| 	if (bLen === 0) { | ||||
| 		return aLen; | ||||
| 	} | ||||
|  | ||||
| 	// 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; | ||||
| 	} | ||||
|  | ||||
| 	// Performing prefix trimming | ||||
| 	// We can linearly drop prefix common to both strings since they | ||||
| 	// don't increase distance at all | ||||
| 	var start = 0; | ||||
|  | ||||
| 	while (start < aLen && (a.charCodeAt(start) === b.charCodeAt(start))) { | ||||
| 		start++; | ||||
| 	} | ||||
|  | ||||
| 	aLen -= start; | ||||
| 	bLen -= start; | ||||
|  | ||||
| 	if (aLen === 0) { | ||||
| 		return bLen; | ||||
| 	} | ||||
|  | ||||
| 	var bCharCode; | ||||
| 	var ret; | ||||
| 	var tmp; | ||||
| 	var tmp2; | ||||
| 	var i = 0; | ||||
| 	var j = 0; | ||||
|  | ||||
| 	while (i < aLen) { | ||||
| 		charCodeCache[start + i] = a.charCodeAt(start + i); | ||||
| 		arr[i] = ++i; | ||||
| 	} | ||||
|  | ||||
| 	while (j < bLen) { | ||||
| 		bCharCode = b.charCodeAt(start + j); | ||||
| 		tmp = j++; | ||||
| 		ret = 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; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return ret; | ||||
| }; | ||||
							
								
								
									
										21
									
								
								node_modules/leven/license
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								node_modules/leven/license
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| The MIT License (MIT) | ||||
|  | ||||
| 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: | ||||
|  | ||||
| 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. | ||||
							
								
								
									
										91
									
								
								node_modules/leven/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								node_modules/leven/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,91 @@ | ||||
| { | ||||
|   "_args": [ | ||||
|     [ | ||||
|       "leven@2.1.0", | ||||
|       "C:\\Users\\Administrator\\Documents\\setup-python" | ||||
|     ] | ||||
|   ], | ||||
|   "_development": true, | ||||
|   "_from": "leven@2.1.0", | ||||
|   "_id": "leven@2.1.0", | ||||
|   "_inBundle": false, | ||||
|   "_integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", | ||||
|   "_location": "/leven", | ||||
|   "_phantomChildren": {}, | ||||
|   "_requested": { | ||||
|     "type": "version", | ||||
|     "registry": true, | ||||
|     "raw": "leven@2.1.0", | ||||
|     "name": "leven", | ||||
|     "escapedName": "leven", | ||||
|     "rawSpec": "2.1.0", | ||||
|     "saveSpec": null, | ||||
|     "fetchSpec": "2.1.0" | ||||
|   }, | ||||
|   "_requiredBy": [ | ||||
|     "/jest-validate" | ||||
|   ], | ||||
|   "_resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", | ||||
|   "_spec": "2.1.0", | ||||
|   "_where": "C:\\Users\\Administrator\\Documents\\setup-python", | ||||
|   "author": { | ||||
|     "name": "Sindre Sorhus", | ||||
|     "email": "sindresorhus@gmail.com", | ||||
|     "url": "sindresorhus.com" | ||||
|   }, | ||||
|   "bugs": { | ||||
|     "url": "https://github.com/sindresorhus/leven/issues" | ||||
|   }, | ||||
|   "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", | ||||
|     "ld": "^0.1.0", | ||||
|     "levdist": "^2.0.0", | ||||
|     "levenshtein": "^1.0.4", | ||||
|     "levenshtein-component": "0.0.1", | ||||
|     "levenshtein-edit-distance": "^2.0.0", | ||||
|     "matcha": "^0.7.0", | ||||
|     "natural": "^0.4.0", | ||||
|     "talisman": "^0.18.0", | ||||
|     "xo": "^0.16.0" | ||||
|   }, | ||||
|   "engines": { | ||||
|     "node": ">=0.10.0" | ||||
|   }, | ||||
|   "files": [ | ||||
|     "index.js" | ||||
|   ], | ||||
|   "homepage": "https://github.com/sindresorhus/leven#readme", | ||||
|   "keywords": [ | ||||
|     "leven", | ||||
|     "levenshtein", | ||||
|     "distance", | ||||
|     "algorithm", | ||||
|     "algo", | ||||
|     "string", | ||||
|     "difference", | ||||
|     "diff", | ||||
|     "fast", | ||||
|     "fuzzy", | ||||
|     "similar", | ||||
|     "similarity", | ||||
|     "compare", | ||||
|     "comparison", | ||||
|     "edit", | ||||
|     "text", | ||||
|     "match", | ||||
|     "matching" | ||||
|   ], | ||||
|   "license": "MIT", | ||||
|   "name": "leven", | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
|     "url": "git+https://github.com/sindresorhus/leven.git" | ||||
|   }, | ||||
|   "scripts": { | ||||
|     "bench": "matcha bench.js", | ||||
|     "test": "xo && ava" | ||||
|   }, | ||||
|   "version": "2.1.0" | ||||
| } | ||||
							
								
								
									
										50
									
								
								node_modules/leven/readme.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								node_modules/leven/readme.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | ||||
| # leven [](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 | ||||
|  | ||||
|  | ||||
| ## Install | ||||
|  | ||||
| ``` | ||||
| $ npm install --save leven | ||||
| ``` | ||||
|  | ||||
|  | ||||
| ## Usage | ||||
|  | ||||
| ```js | ||||
| const leven = require('leven'); | ||||
|  | ||||
| leven('cat', 'cow'); | ||||
| //=> 2 | ||||
| ``` | ||||
|  | ||||
|  | ||||
| ## Benchmark | ||||
|  | ||||
| ``` | ||||
| $ 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 | ||||
| ``` | ||||
|  | ||||
|  | ||||
| ## Related | ||||
|  | ||||
| - [leven-cli](https://github.com/sindresorhus/leven-cli) - CLI for this module | ||||
|  | ||||
|  | ||||
| ## License | ||||
|  | ||||
| MIT © [Sindre Sorhus](https://sindresorhus.com) | ||||
		Reference in New Issue
	
	Block a user
	 Danny McCormick
					Danny McCormick