angular/packages/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
..
src fix(core): fix narrowing of Resource.hasValue() (#63994) 2025-09-23 14:20:55 +00:00
test fix(core): fix narrowing of Resource.hasValue() (#63994) 2025-09-23 14:20:55 +00:00
testing build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
BUILD.bazel build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
index.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
PACKAGE.md docs: Update guide link in http package md file (#59955) 2025-04-08 09:20:19 -07:00
public_api.ts feat(http): Provide http services in root (#56212) 2025-08-14 13:04:35 +02:00