-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed the search, did know why it broke
- Loading branch information
Mark van der Steenhoven
committed
Oct 30, 2023
1 parent
d1b7969
commit 44d49c0
Showing
2 changed files
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
import { City } from "./types/city"; | ||
import { searchCity } from "./search"; | ||
|
||
import * as cities from "./cities.json"; | ||
|
||
export const searchOne = async ( | ||
needle: string, | ||
): Promise<{ item: City; refIndex: number }> => { | ||
return searchCity(cities, needle)[0]; | ||
export const searchOne = (needle: string): { item: City; refIndex: number } => { | ||
return searchCity(needle)[0]; | ||
}; | ||
export const search = async ( | ||
needle: string, | ||
): Promise<{ item: City; refIndex: number }[]> => { | ||
return searchCity(cities, needle); | ||
export const search = (needle: string): { item: City; refIndex: number }[] => { | ||
return searchCity(needle); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters