Context
In packages/modules/services/src/people/is-api-person.ts, the isApiPerson type-guard factory only checks for the presence of required attributes:
export const isApiPerson = <V extends keyof typeof ApiVersion>(version: V) => {
/** todo add options for more strict check */
return <T>(value: T): value is T extends ApiPerson<V> ? T : never => {
...
Task
- Add an options parameter (e.g.
{ strict?: boolean }) to isApiPerson allowing callers to opt into a stricter check (e.g. validating value types of required attributes, not just presence).
- Document the new option in the function's TSDoc with an example.
File
packages/modules/services/src/people/is-api-person.ts (line ~37)
Context
In
packages/modules/services/src/people/is-api-person.ts, theisApiPersontype-guard factory only checks for the presence of required attributes:Task
{ strict?: boolean }) toisApiPersonallowing callers to opt into a stricter check (e.g. validating value types of required attributes, not just presence).File
packages/modules/services/src/people/is-api-person.ts(line ~37)