UNPKG

@rero/ng-core

Version:

RERO angular core library.

42 lines (41 loc) 1.4 kB
import { JSONSchema7 as JSONSchema7Base } from 'json-schema'; export interface JSONSchema7 extends JSONSchema7Base { widget: any; } /** * Resolve $ref definition and set properties on field * @param schema - json schema all properties * @param schemaProperties - json schema level * @returns the updated schema */ export declare function resolve$ref(schema: any, schemaProperties: any): any; /** * Process JSONSchema * This re-order the object properties given a local defined * `propertiesOrder` property. * The process the required properties given a local defined * `required` property. * @param schema - object, the JSONSchema * @returns object, a converted JSONSchema */ export declare function processJsonSchema(schema: any): any; /** * Replace $ref by pid * * @param schema - object, the JSONSchema * @param data - object, the data to be cleaned * @returns object, a fresh copy of the data with replacements */ export declare function resolveRefs(data: any): any; /** * Tell if a value can be considered as empty * @param value - any, the value to check * @returns boolean, true if the value is empty */ export declare function isEmpty(value: any): boolean; /** * Recursively remove the empty values * @param data - object, the data to be cleaned * @returns object, a fresh copy of the clean data */ export declare function removeEmptyValues(data: any): any;