Skip to content

Commit

Permalink
[ML] Extends description.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Mar 31, 2021
1 parent 4bc7527 commit eb6dd1e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions x-pack/plugins/ml/common/util/object_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
*
* Examples:
* - `isPopulatedObject({...})`
* limits type to Record<string, unknown>
* Limits type to Record<string, unknown>
*
* - `isPopulatedObject({...}, ['attribute'])`
* limits type to Record<'attribute', unknown>
* Limits type to Record<'attribute', unknown>
*
* - `isPopulatedObject<keyof MyInterface>({...})`
* 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 = <U extends string = string>(
arg: unknown,
Expand Down

0 comments on commit eb6dd1e

Please sign in to comment.