angular/goldens/public-api/common/http
JoostK 50d9d55f49 fix(core): fix narrowing of Resource.hasValue() (#63994)
This commit changes `Resource.hasValue()` and its derived types to improve narrowing
of resources whose generic type either does not include `undefined` (i.e. when a default
value has been provided) or when the generic type is `unknown`. This fixes the undesirable
behavior where `hasValue()` would cause the `else` branch of an `hasValue()` conditional
to have a narrowed type of `never`, given that the `hasValue()`'s type guard covers the
entire type range already (meaning that the type in the else-branch cannot be inhabited
in the type system, yielding the `never` type).

By making the `hasValue()` method only a type guard when the generic type includes `undefined`
these problems are avoided.

Fixes #60766
Fixes #63545
Fixes #63982

PR Close #63994
2025-09-23 14:20:55 +00:00
..
testing build(common): updating golden files for the @angular/common package (#60623) 2025-04-01 15:58:51 +00:00
errors.api.md docs: add documentation for NG02802 warning about HttpTransferCache headers (#63802) 2025-09-15 15:38:24 +00:00
index.api.md fix(core): fix narrowing of Resource.hasValue() (#63994) 2025-09-23 14:20:55 +00:00