@appsemble/utils
Version:
Utility functions used in Appsemble internally
29 lines • 738 B
JavaScript
/**
* Return the input data.
*
* @param data The data to return.
* @returns The input data.
*/
export function identity(data) {
return data;
}
/**
* Throw the input data.
*
* @param data The data to throw.
* @throws The input data.
*/
export function rethrow(data) {
throw data;
}
/**
* 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 function has(target, key) {
return target != null && target !== undefined && Object.hasOwnProperty.call(target, key);
}
//# sourceMappingURL=miscellaneous.js.map