angular/packages/common
JoostK 9515a70933 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
locales refactor(common): trim undefined from locale data. (#63520) 2025-09-17 14:57:17 +00:00
src build: add a noDuplicateEnumValue rule (#63483) 2025-09-10 22:16:11 +00:00
test refactor(core): Update tests for zoneless by default (#63672) 2025-09-09 15:07:24 -07:00
testing build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
upgrade refactor(bazel): reduce build deps (#63348) 2025-08-28 09:16:10 -07:00
BUILD.bazel build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
index.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
package.json build: update common's locales to use rules_js (#61629) 2025-05-26 10:18:14 +00:00
PACKAGE.md docs: add api doc to sub-packages (#33801) 2019-11-20 14:48:50 -08:00
public_api.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00