Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
abelkhay committed Dec 21, 2023
1 parent f251c3d commit e435c91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformer/fields/id/id.field.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Id } from '@gouvfr-anct/lieux-de-mediation-numerique';
import { LieuxMediationNumeriqueMatching, DataSource, Colonne } from '../../input';

const IdIsEmptyInSource = (source: DataSource, id: Colonne): boolean => source[id.colonne] == null || source[id.colonne] === '';
const idIsEmptyInSource = (source: DataSource, id: Colonne): boolean => source[id.colonne] == null || source[id.colonne] === '';

export const processId = (source: DataSource, matching: LieuxMediationNumeriqueMatching, index: number): Id =>
Id(
(matching.id == null || (matching.id != null && IdIsEmptyInSource(source, matching.id))
(matching.id == null || idIsEmptyInSource(source, matching.id)
? index.toString()
: source[matching.id.colonne]?.toString()) ?? index.toString()
);

0 comments on commit e435c91

Please sign in to comment.