Skip to content

Commit d0a6c00

Browse files
committed
chore: adds a fix script
1 parent 3fb27dd commit d0a6c00

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lesson_07/conditionals/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"prepare": "npm run compile",
1111
"pretest": "npm run compile",
1212
"lint": "eslint \"{src,test}/**/*.{ts,tsx}\"",
13-
"check": "npm run lint && npm run test"
13+
"check": "npm run lint && npm run test",
14+
"fix": "prettier . --write"
1415
},
1516
"author": "",
1617
"license": "ISC",

lesson_07/conditionals/src/util.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
2-
/**
3-
* Computes a score describing the lexicographic distance between two strings. For two strings of
4-
* equal length, the score will be the difference between the first differing character. In the
5-
* case where either is a sub-string of the other, then the difference in length determines the
6-
* score.
7-
*
8-
* @param a The first string to compare.
9-
* @param b The second string to compare.
10-
* @return A score representing the lexicographic distance between two strings.
11-
*/
1+
/**
2+
* Computes a score describing the lexicographic distance between two strings. For two strings of
3+
* equal length, the score will be the difference between the first differing character. In the
4+
* case where either is a sub-string of the other, then the difference in length determines the
5+
* score.
6+
*
7+
* @param a The first string to compare.
8+
* @param b The second string to compare.
9+
* @return A score representing the lexicographic distance between two strings.
10+
*/
1211
export function computeLexicographicDistance(a: string, b: string): number {
1312
const minLength = Math.min(a.length, b.length);
1413
for (let i = 0; i < minLength; i++) {
@@ -17,4 +16,4 @@ export function computeLexicographicDistance(a: string, b: string): number {
1716
}
1817
}
1918
return a.length - b.length;
20-
}
19+
}

0 commit comments

Comments
 (0)