From 3f5daf802924b455963f637cc434d5edafff3ed5 Mon Sep 17 00:00:00 2001 From: bubkoo Date: Mon, 17 Oct 2022 11:07:23 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=94=A7=20running=20action=20on?= =?UTF-8?q?=20Node16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 2 +- package.json | 2 +- src/algo.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 1be26b0..679d985 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/package.json b/package.json index 8ed147f..31135a0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/algo.ts b/src/algo.ts index 8d2c63d..4952eea 100644 --- a/src/algo.ts +++ b/src/algo.ts @@ -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()`):