Skip to content
API/readNumber

readNumber

src/utils/read-path.tsfunction
readNumber(response: RawResponse, path: string): number | undefined

Read a path expected to hold a number.

Values that are not numbers resolve to undefined rather than being coerced, so a malformed envelope surfaces as “absent” instead of NaN.

Parameter Type Description
response RawResponse The raw response body
path string Dot-separated path

Returns — The number at that path, or undefined