refactor: introduce dedicated identifier types for improved clarity and type safety
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export interface CorrespondentReference {
|
||||
id?: string | number | null;
|
||||
id?: string | null;
|
||||
name?: string | null;
|
||||
key?: string;
|
||||
}
|
||||
@@ -9,9 +9,9 @@ export interface DocumentLike {
|
||||
}
|
||||
|
||||
export interface ResolvedCorrespondent {
|
||||
id?: string | number | null;
|
||||
id?: string | null;
|
||||
name: string;
|
||||
key: string | number;
|
||||
key: string;
|
||||
}
|
||||
|
||||
export const resolveCorrespondents = (doc?: DocumentLike | null): ResolvedCorrespondent[] => {
|
||||
@@ -19,7 +19,7 @@ export const resolveCorrespondents = (doc?: DocumentLike | null): ResolvedCorres
|
||||
return [];
|
||||
}
|
||||
|
||||
const seen = new Set<string | number>();
|
||||
const seen = new Set<string>();
|
||||
const results: ResolvedCorrespondent[] = [];
|
||||
|
||||
doc.correspondents.forEach((entry = {}, index) => {
|
||||
|
||||
Reference in New Issue
Block a user