2
0
mirror of https://github.com/frappe/books.git synced 2024-11-13 00:46:28 +00:00
books/utils/misc.ts
18alantom 76c61a5c29 incr: get setupwizard to display
- make converter more explicit
2022-05-23 16:18:22 +05:30

18 lines
457 B
TypeScript

import countryInfo from 'fixtures/countryInfo.json';
import { CountryInfoMap } from './types';
export function getCountryInfo(): CountryInfoMap {
// @ts-ignore
return countryInfo as CountryInfoMap;
}
export function getCountryCodeFromCountry(countryName: string): string {
const countryInfoMap = getCountryInfo();
const countryInfo = countryInfoMap[countryName];
if (countryInfo === undefined) {
return '';
}
return countryInfo.code;
}