import { Schema, TypeName } from '../../../schema' import { Analyze, AnalyzeAndInpect } from '../../analyze' import { Namespace, PropertyResult } from '../../index' import { PropertyValidator } from '../validator' export * from '../../../schema' export { Analyze, AnalyzeAndInpect } from '../../analyze' export { Informer, Namespace, PropertyResult } from '../../index' export { checkSchemaType, getInputType, getSchemaType, TypeInt } from '../schema-type' export const propertyResultOk: PropertyResult = { property: '' as Namespace, description: '', type: 'OK' } export type PropertyValidationParams = { analyze: Analyze schema: S validator: PropertyValidator required: boolean } export type PropertyInformationParams = { analyze: AnalyzeAndInpect schema: S validator: PropertyValidator required: boolean } export type StatsStringValue = { count: number empty: number notEmpty: number minLength?: number maxLength?: number } export type StatsNumberValue = { count: number minimum?: number maximum?: number } export type StatsArrayValue = { count: number empty: number notEmpty: number minItems?: number maxItems?: number } export type StatsEnumValue = { count: number enum: { [key: string]: number } } export function getSchemaKeys(schema: T, keys: Array): Partial { return keys.reduce((acc, key) => { const value = schema[key] if (value != null) { acc[key] = value } return acc }, {}) }