-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Open
Labels
Feature:Saved ObjectsTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//good first issuelow hanging fruitlow hanging fruit💝community
Description
The is an existing pattern of using // @ts-expect-error MultiGetHit._source is optional comments in the saved object repository code that weakens the type safety.
We should use a type guard instead
/**
* Type guard to check if an item is a GetGetResult.
*/
export function isGetGetResult<TDocument = unknown>(
item: MgetResponseItem<TDocument>
): item is GetGetResult<TDocument> {
return (item as MgetMultiGetError).error === undefined;
}
Originally posted by @rudolf in #224411 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Feature:Saved ObjectsTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//good first issuelow hanging fruitlow hanging fruit💝community
Type
Fields
Give feedbackNo fields configured for Task.