@appsemble/utils
Version:
Utility functions used in Appsemble internally
23 lines (22 loc) • 654 B
TypeScript
/**
* Return the input data.
*
* @param data The data to return.
* @returns The input data.
*/
export declare function identity<T>(data: T): T;
/**
* Throw the input data.
*
* @param data The data to throw.
* @throws The input data.
*/
export declare function rethrow(data: unknown): never;
/**
* Check if the target has an own property named after the key.
*
* @param target The target that should have the key. Null values are also accepted.
* @param key The key to check for on the target.
* @returns Whether or not the key exists on the target.
*/
export declare function has(target: object | null | undefined, key: string): boolean;