stats §8: Curaçao from ILOSTAT (SDMX), OWID, UN SDG 531, UN Comtrade 531 (cwintl + weekly timer), EU trade with CW (Eurostat ext_lt_maineu); CBS Curaçao LFS file pick fix; Curaçao detail panels on /stats/countries/CUW
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
This commit is contained in:
@@ -359,7 +359,9 @@ export const TABLES: Table[] = [
|
||||
match: /labour force survey.*age.groups.*\.xlsx$/i,
|
||||
table: 'cw_cbs_lfs',
|
||||
owns: `age_group <> '15+'`,
|
||||
parse: parseLfs
|
||||
// The 15+ totals come from the by-sex file; older age-group uploads repeat them per sheet.
|
||||
parse: async (path: string) =>
|
||||
(await parseLfs(path)).filter((r) => (r as { age_group: string }).age_group !== '15+')
|
||||
},
|
||||
{
|
||||
key: 'tourism_cruise',
|
||||
@@ -421,7 +423,12 @@ async function links(page: string): Promise<string[]> {
|
||||
const html = await (await http(`${SITE}/${page}`)).text();
|
||||
const urls = new Set<string>();
|
||||
for (const m of html.replace(/&/g, '&').matchAll(CDN)) urls.add(m[0]);
|
||||
return [...urls].sort((a, b) => decodeURIComponent(b).localeCompare(decodeURIComponent(a)));
|
||||
// Plain code-point order (not localeCompare, which ignores punctuation): the CMS re-upload
|
||||
// suffix `_0` then sorts ahead of the original, so the newest copy of a file wins.
|
||||
return [...urls]
|
||||
.map((u) => [u, decodeURIComponent(u)] as const)
|
||||
.sort((a, b) => (a[1] < b[1] ? 1 : a[1] > b[1] ? -1 : 0))
|
||||
.map(([u]) => u);
|
||||
}
|
||||
const fileName = (url: string) => decodeURIComponent(url.split('/uploads/')[1] ?? url);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user