From eb6dd1eaac66b715a7f798a645bc552c0ed493ff Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Wed, 31 Mar 2021 14:20:51 +0200 Subject: [PATCH] [ML] Extends description. --- x-pack/plugins/ml/common/util/object_utils.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ml/common/util/object_utils.ts b/x-pack/plugins/ml/common/util/object_utils.ts index dc072001f99b90..537ee9202b4dec 100644 --- a/x-pack/plugins/ml/common/util/object_utils.ts +++ b/x-pack/plugins/ml/common/util/object_utils.ts @@ -10,13 +10,17 @@ * * Examples: * - `isPopulatedObject({...})` - * limits type to Record + * Limits type to Record * * - `isPopulatedObject({...}, ['attribute'])` - * limits type to Record<'attribute', unknown> + * Limits type to Record<'attribute', unknown> * * - `isPopulatedObject({...})` - * limits type to a record with keys of the given interface + * Limits type to a record with keys of the given interface. + * Note that you might want to add keys from the interface to the + * array of requiredAttributes to satisfy runtime requirements. + * Otherwise you'd just satisfy TS requirements but might still + * run into runtime issues. */ export const isPopulatedObject = ( arg: unknown,