UNPKG

@granito/ngx-hal-client

Version:

A HAL client to be used in Angular projects

21 lines (20 loc) 909 B
/** * Convert any item, be that a {@link Resource} or {@link Collection} * to a plain {@link Object} or {@link Array}. On conversion * HAL-related properties (`_client`, `_links`, `_embedded`) * are not included in the resulting object. Primitive types * as well as `null` or `undefined` are returned unchanged. * If the argument is an array, every item of the returned array * is converted recursively. For {@link Collection} it returns * the array of values where each item is converted recursively. * * @param item the item to convert * @returns an object, array, primitive value, `undefined` or `null` */ export declare function objectFrom(item: any): any; /** * @param arg argument to test * @returns `false` if the argument is `null` or `undefined` and `true` * otherwise */ export declare function isDefined<T>(arg: T | null | undefined): arg is T extends null | undefined ? never : T;