angular/goldens/public-api/common
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
..
http fix(core): fix narrowing of Resource.hasValue() (#63994) 2025-09-23 14:20:55 +00:00
testing docs: rename @nodoc to @docs-private (#61194) 2025-05-09 10:23:00 -07:00
upgrade refactor(common): removengModuleFactory input of NgComponentOutlet (#62838) 2025-08-20 13:27:18 +00:00
errors.api.md build: add a noDuplicateEnumValue rule (#63483) 2025-09-10 22:16:10 +00:00
index.api.md refactor(common): improve typing of ngComponentOutletContent (#63674) 2025-09-10 22:26:27 +00:00