mirror of
https://github.com/iv-org/close-potential-duplicates.git
synced 2024-11-23 05:49:44 +00:00
chore: 🔧 running action on Node16
This commit is contained in:
parent
e58dfb2e84
commit
3f5daf8029
@ -34,7 +34,7 @@ inputs:
|
||||
description: Reactions to be add to comment when potential duplicates are detected.
|
||||
required: false
|
||||
runs:
|
||||
using: node12
|
||||
using: node16
|
||||
main: dist/index.js
|
||||
branding:
|
||||
icon: type
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "potential-duplicates",
|
||||
"description": "Search for potential issue duplicates using Damerau–Levenshtein algorithm.",
|
||||
"version": "1.0.9",
|
||||
"version": "1.1.0",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist",
|
||||
|
@ -83,9 +83,9 @@ export namespace Algo {
|
||||
* Compares two strings and returns how similar they are. The result is a
|
||||
* float in interval [0.0; 1.0].
|
||||
*/
|
||||
function similarity(i: string, j: string) {
|
||||
const length = Math.max(i.length, j.length)
|
||||
return length === 0 ? 1.0 : (length - distance(i, j)) / length
|
||||
function similarity(a: string, b: string) {
|
||||
const length = Math.max(a.length, b.length)
|
||||
return length === 0 ? 1.0 : (length - distance(a, b)) / length
|
||||
}
|
||||
|
||||
// How many points remove per missing word (see `compare()`):
|
||||
|
Loading…
Reference in New Issue
Block a user