1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 02:44:45 +00:00

refactor(packages/stdlib): levensthein fn replate to module export

This commit is contained in:
2024-04-11 00:22:20 +07:00
parent 002215303a
commit 92721b348a
3 changed files with 3 additions and 2 deletions

View File

@@ -1 +1,2 @@
export * from './text';
export * from './math';

View File

@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import levenshteinDistance from '.';
import {levenshteinDistance} from '.';
describe('levenshteinDistance', () => {
it('should calculate edit distance between two strings', () => {

View File

@@ -5,7 +5,7 @@
* @param {string} b Second string
* @returns {number} The Levenshtein distance between the two strings
*/
export default function levenshteinDistance(a: string, b: string): number {
export function levenshteinDistance(a: string, b: string): number {
// If the strings are equal, the distance is 0
if (a === b) return 0;