@messari/sdk
Version:
Messari SDK provides a type-safe, intuitive interface for accessing Messari's suite of crypto data and AI APIs.
33 lines (32 loc) • 1.13 kB
TypeScript
/**
* Utility for enforcing exhaustiveness checks in the type system.
*
* @see https://basarat.gitbook.io/typescript/type-system/discriminated-unions#throw-in-exhaustive-checks
*
* @param value The variable with no remaining values
*/
export declare const assertNever: (value: never) => never;
/**
* Utility for picking specific keys from an object.
*
* @param base The object to pick keys from.
* @param keys The keys to pick from the object.
* @returns A new object containing only the picked keys.
*/
type AllKeys<T> = T extends unknown ? keyof T : never;
/**
* Utility for picking specific keys from an object.
*
* @param base The object to pick keys from.
* @param keys The keys to pick from the object.
* @returns A new object containing only the picked keys.
*/
export declare const pick: <O, K extends AllKeys<O>>(base: O, keys: readonly K[]) => Pick<O, K>;
/**
* Utility for checking if a value is an object.
*
* @param o The value to check.
* @returns True if the value is an object, false otherwise.
*/
export declare const isObject: (o: unknown) => o is Record<PropertyKey, unknown>;
export {};