UNPKG

bankcode-bic

Version:

Convert bank codes from IBAN to BICs, Name of bank. Currently supports only some selected EU countries.

25 lines (24 loc) 564 B
//#region src/download/download.ts const fieldNames = [ "bankcode", "bic", "name", "address", "postcode", "city", "phone", "fax", "email", "website" ]; const getField = (() => { const fieldMap = /* @__PURE__ */ new Map(); fieldNames.forEach((name, index) => fieldMap.set(name.toLowerCase(), index)); return (colName, row) => { const index = fieldMap.get(colName.toLowerCase()); if (index === void 0) throw new Error(`Column name "${colName}" not found in field names`); return row[index]; }; })(); //#endregion export { fieldNames, getField };