logos-bancos-br 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import {
2
- banks,
2
+ allInstitutions,
3
3
  findBank,
4
4
  normalizeCompe,
5
5
  normalizeIspb
6
- } from "./chunk-RKLZTMIS.js";
6
+ } from "./chunk-657XZKD5.js";
7
7
 
8
8
  // src/node.ts
9
9
  import { copyFileSync, existsSync, mkdirSync } from "fs";
@@ -35,9 +35,16 @@ function copyLogos({
35
35
  mkdirSync(dest, { recursive: true });
36
36
  const copied = [];
37
37
  const skippedNoSvg = [];
38
- for (const bank of banks()) {
38
+ const skippedNoCompe = [];
39
+ for (const bank of allInstitutions()) {
39
40
  if (!bank.logo) continue;
40
- if (filter && !filter.has(bank.compe4) && !filter.has(bank.ispb)) continue;
41
+ if (filter && !(bank.compe4 !== null && filter.has(bank.compe4)) && !filter.has(bank.ispb)) {
42
+ continue;
43
+ }
44
+ if (by === "compe" && !bank.compe4) {
45
+ skippedNoCompe.push(bank.ispb);
46
+ continue;
47
+ }
41
48
  const baseName = by === "ispb" ? bank.ispb : bank.compe4;
42
49
  if (format === "png" || format === "both") {
43
50
  const source = packagePath(bank.logo.png);
@@ -56,11 +63,11 @@ function copyLogos({
56
63
  copied.push(target);
57
64
  }
58
65
  } else {
59
- skippedNoSvg.push(bank.compe4);
66
+ skippedNoSvg.push(bank.compe4 ?? bank.ispb);
60
67
  }
61
68
  }
62
69
  }
63
- return { copied, skippedNoSvg };
70
+ return { copied, skippedNoSvg, skippedNoCompe };
64
71
  }
65
72
 
66
73
  export {