banks-helper 1.3.0 → 1.3.2
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.
- package/.editorconfig +9 -0
- package/IBankLogoItem.ts +4 -4
- package/banks.ts +772 -773
- package/index.ts +10 -10
- package/package.json +1 -1
- package/tsconfig.json +5 -2
package/index.ts
CHANGED
|
@@ -4,24 +4,24 @@ import { IBankLogoItem } from './IBankLogoItem';
|
|
|
4
4
|
const UNKNOWN_BANK_FILE_NAME = 'unknown.svg';
|
|
5
5
|
|
|
6
6
|
const findBank = (bankName: string): IBankLogoItem => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
return banks.find(({ matchedBankNames, humanName }) => {
|
|
8
|
+
return [...matchedBankNames, humanName].includes(bankName);
|
|
9
|
+
});
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const getBankLogoFileName = (bankName: string) => {
|
|
13
|
-
|
|
13
|
+
const bankLogoItem = findBank(bankName);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
return bankLogoItem?.fileName ?? UNKNOWN_BANK_FILE_NAME;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const getBankLogoName = (bankName: string): string => {
|
|
19
|
-
|
|
19
|
+
const bankLogoItem = findBank(bankName);
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
return bankLogoItem?.humanName ?? bankName;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
25
|
+
getBankLogoFileName,
|
|
26
|
+
getBankLogoName,
|
|
27
|
+
};
|
package/package.json
CHANGED