@exmg/livery
Version:
Ex Machina Group Livery Web SDK.
32 lines (31 loc) • 1.01 kB
TypeScript
/**
* This module provides stricter typed alternatives to Object.keys(), values() and entries().
*
* These methods do little more then return Object.keys/values/entries(obj),
* but they can only be used with plain objects as class instances can have more properties.
*
* @see https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208
*/
/**
* Returns true if value is a plain object.
* @param value
*/
export declare function isPlainObject(value: unknown): boolean;
/**
* Returns the keys of the plain object properties.
*
* @param obj Plain Object
*/
export declare function keys<T, K extends keyof T>(obj: T): K[];
/**
* Returns an array of values of the plain object properties.
*
* @param obj Plain Object
*/
export declare function values<T, K extends keyof T>(obj: T): T[K][];
/**
* Returns an array of [key, value] tuples of the plain object properties.
*
* @param obj Plain Object
*/
export declare function entries<T, K extends keyof T>(obj: T): [K, T[K]][];