-
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.
Улучшил ввод телефона. Добавил определение России по языку. Улучшил п…
…оиск кода по введенному тексту.
- Loading branch information
Showing
3 changed files
with
27 additions
and
23 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,9 +1,7 @@ | ||
export class Geolocator { | ||
async getCurrentRegion(): Promise<string> { | ||
return fetch('https://api.country.is').then((response) => | ||
response | ||
.json() | ||
.then((data: { ip: string; country: string }) => data.country) | ||
) | ||
const response = await fetch('https://api.country.is') | ||
const json: { ip: string; country: string } = await response.json() | ||
return json.country | ||
} | ||
} |
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
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