UNPKG

countrycodejs

Version:
14 lines (13 loc) 497 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const countries_json_1 = __importDefault(require("./countries.json")); exports.byISOCode = (isoCode) => { const foundCountry = countries_json_1.default.find((country) => country.code === isoCode); if (!foundCountry) { return null; } return foundCountry; };