Skip to content

Commit 6c5236b

Browse files
authoredAug 24, 2021
Merge pull request #16 from G07cha/types/readonly-array
types: mark input array as readonly
2 parents a5b15ab + 9ca715b commit 6c5236b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎mod.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const distance = (a: string, b: string): number => {
126126
return myers_x(a, b);
127127
};
128128

129-
const closest = (str: string, arr: string[]): string => {
129+
const closest = (str: string, arr: readonly string[]): string => {
130130
let min_distance = Infinity;
131131
let min_index = 0;
132132
for (let i = 0; i < arr.length; i++) {

0 commit comments

Comments
 (0)
Please sign in to comment.