From 70cbbfb29138c1ab353e2757f298b35fe6234223 Mon Sep 17 00:00:00 2001 From: Ewan Date: Fri, 12 Jan 2024 11:38:39 +1100 Subject: [PATCH] Fix typo in editDistance option name --- .changeset/clever-ways-smash.md | 5 +++++ lib/strings/editDistance.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/clever-ways-smash.md diff --git a/.changeset/clever-ways-smash.md b/.changeset/clever-ways-smash.md new file mode 100644 index 0000000..8452145 --- /dev/null +++ b/.changeset/clever-ways-smash.md @@ -0,0 +1,5 @@ +--- +"@giraugh/tools": patch +--- + +Fix typo in editDistance option name diff --git a/lib/strings/editDistance.ts b/lib/strings/editDistance.ts index 62a021a..0be7eaa 100644 --- a/lib/strings/editDistance.ts +++ b/lib/strings/editDistance.ts @@ -2,7 +2,7 @@ export type EditDistanceOptions = { weights: { insertion?: number, deletion?: number, - substition?: number, + substitution?: number, } } @@ -31,7 +31,7 @@ export const editDistance = (source: string, target: string, options?: Partial { expect(editDistance('', 'abc', { weights: { insertion: 2 } })).toBe(6) expect(editDistance('abc', '', { weights: { deletion: 2 } })).toBe(6) - expect(editDistance('abc', 'defg', { weights: { substition: 2, insertion: 3 } })).toBe(9) + expect(editDistance('abc', 'defg', { weights: { substitution: 2, insertion: 3 } })).toBe(9) }) }