mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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 |
||
|---|---|---|
| .. | ||
| backend.ts | ||
| client.ts | ||
| context.ts | ||
| errors.ts | ||
| fetch.ts | ||
| headers.ts | ||
| interceptor.ts | ||
| jsonp.ts | ||
| module.ts | ||
| params.ts | ||
| private_export.ts | ||
| provider.ts | ||
| request.ts | ||
| resource.ts | ||
| resource_api.ts | ||
| response.ts | ||
| transfer_cache.ts | ||
| xhr.ts | ||
| xsrf.ts | ||