fix: narrow parseBrpAddress's return type instead of leaking the DTO
BrpAddressDto's fields are generated as optional, so returning it directly from parseBrpAddress lost the narrowing the runtime check already did. This broke the build once registratie-lookup.store.ts assigned the parsed address into a stricter local type. Map to a proper BrpAddress domain shape at the trust boundary instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,7 @@ export class RegistratieLookupStore {
|
||||
const json = this.adresRes.value();
|
||||
if (json === undefined) return null;
|
||||
const parsed = parseBrpAddress(json);
|
||||
return parsed.ok && parsed.value.gevonden && parsed.value.adres ? parsed.value.adres : null;
|
||||
return parsed.ok && parsed.value.adres ? parsed.value.adres : null;
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user