chore: 🔧 running action on Node16

This commit is contained in:
bubkoo 2022-10-17 11:07:23 +08:00
parent e58dfb2e84
commit 3f5daf8029
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -1,7 +1,7 @@
{
"name": "potential-duplicates",
"description": "Search for potential issue duplicates using DamerauLevenshtein algorithm.",
"version": "1.0.9",
"version": "1.1.0",
"main": "dist/index.js",
"files": [
"dist",

View File

@ -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()`):