1import { getJsonCached } from '../../resource-loader.js'; 2 3export const COUNTRIES_RESOURCE_PATH = 'staticData/countries.json'; 4export const COUNTRIES_RESOURCE_LOAD_ATTEMPTS = 2; 5 6const cloneCountry = (country) => ({ ...country }); 7 8export const loadCountries = async () => { 9 for (let attempt = 0; attempt < COUNTRIES_RESOURCE_LOAD_ATTEMPTS; attempt += 1) { 10 const countries = await getJsonCached(COUNTRIES_RESOURCE_PATH); 11 if (Array.isArray(countries) && countries.length) { 12 return countries.map(cloneCountry); 13 } 14 } 15 16 throw new Error('Countries static data is unavailable'); 17};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.