Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
norkator committed Oct 25, 2023
1 parent fa008ad commit b289c15
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,7 @@ interface StatementDetailEntry {
};
};
};
relatedParties?: {
type: string | null;
name: string | null;
};
relatedParties?: RelatedPartiesInterface;
remittanceInformation: {
unstructured: string;
};
Expand All @@ -528,6 +525,11 @@ interface StatementDetailEntry {
};
}

interface RelatedPartiesInterface {
type: string | null;
name: string | null;
}

export {
ApplicationRequestSignatureInterface,
AxiosAgentInterface,
Expand Down Expand Up @@ -557,4 +559,5 @@ export {
StatementEntry,
StatementDetailEntry,
BalanceEntry,
RelatedPartiesInterface,
}
15 changes: 12 additions & 3 deletions src/utils/parsers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import {CodeOrProprietary, CreditDebitIndicator, Domain, FamilyCode, SubFamilyCode} from './../constants';
import {CodeOrProprietary, CreditDebitIndicator, Domain, FamilyCode, SubFamilyCode} from '../constants';
import {Base64DecodeStr, ParseXml, GetNested, GetExternalStatusCodeDescriptions} from './utils';
import {BalanceEntry, BankStatement, PaymentStatusReport, StatementDetailEntry, StatementEntry} from '../interfaces';
import {
BalanceEntry,
BankStatement,
PaymentStatusReport,
RelatedPartiesInterface,
StatementDetailEntry,
StatementEntry
} from '../interfaces';

/**
* Parses content from payment status report
Expand Down Expand Up @@ -203,11 +210,13 @@ function parseStatementDetailEntries(detailEntriesObject: any[]): StatementDetai
}


function parseRelatedParties(rltdPties: any): { type: string | null; name: string | null; } {
function parseRelatedParties(rltdPties: any): RelatedPartiesInterface {
try {
const key = Object.keys(rltdPties[0])[0];

return {type: key, name: rltdPties[0][key][0]['Nm'][0]};
} catch (e) {

return {type: null, name: null};
}
}
Expand Down

0 comments on commit b289c15

Please sign in to comment.