MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / formatCsvFile

Function formatCsvFile

services/banco-central/index.js:5–29  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

3import banksList from './banksList.json';
4
5const formatCsvFile = (file) => {
6 // Remove o cabeçalho
7 file.shift();
8
9 return file
10 .filter(([ispb, , code]) => ispb && code)
11 .map(
12 ([
13 ispb, // ISPB
14 name, // Nome_Reduzido
15 code, // Número_Código // Participa_da_Compe // Acesso_Principal
16 ,
17 ,
18 fullName, // Nome_Extenso // Início_da_Operação
19 ,
20 ]) => {
21 return {
22 ispb,
23 name: name && name.trim(),
24 code: Number(code),
25 fullName: fullName && fullName.trim().replace(/\\"|"/g, ''), // Remove aspas
26 };
27 }
28 );
29};
30
31export const getBanksData = async () => {
32 try {

Callers 1

getBanksDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected