Skip to content

Commit

Permalink
style: format code with Prettier
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 2821ddd according to the output
from Prettier.

Details: #18
  • Loading branch information
deepsource-autofix[bot] committed May 27, 2024
1 parent 2821ddd commit 6fba386
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/pico.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function picoSearch<T>(
objectsArray: T[],
searchTerm: string,
keys: Keys,
config: { threshold: number }
config: { threshold: number },
): T[] {
if (!searchTerm || typeof searchTerm !== "string") {
return objectsArray;
Expand Down Expand Up @@ -69,7 +69,7 @@ export function picoSearch<T>(

const similarityForObject = weightedAverage(
similarityScores,
weightsInOrder
weightsInOrder,
);

if (similarityForObject >= threshold) {
Expand All @@ -94,7 +94,7 @@ function splitWordsAndRank(valueToSearch: string, splitSearchTerm: string[]) {

const splitScores = splitSearchTerm.map((searchWord) => {
const similarityValues = splitSearchCandidate.map((word) =>
getScoreForWord(word, searchWord)
getScoreForWord(word, searchWord),
);

const maxSimilarity = Math.max(...similarityValues);
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function weightedAverage(values: number[], weights?: number[]): number {

if (weights && values.length !== weights.length) {
throw new Error(
"The number of values must be equal to the number of weights"
"The number of values must be equal to the number of weights",
);
}

Expand Down
2 changes: 1 addition & 1 deletion test/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("weightedAverage", () => {
const values = [1, 2, 3];
const weights = [1, 2, 3, 4, 5];
expect(() => weightedAverage(values, weights)).toThrow(
"The number of values must be equal to the number of weights"
"The number of values must be equal to the number of weights",
);
});
});
Expand Down

0 comments on commit 6fba386

Please sign in to comment.