import { hasKeyMatching } from '~/data/helpers/is-themis-schema/load/has-key'; import { IIsThemisSchema } from '~/data/helpers/is-themis-schema/protocol'; import { ValidationSchemas } from '~/domain'; export class CheckSchemaKeyAdapter { constructor(private readonly checkKey: IIsThemisSchema.CheckValueKey) {} check = (value: any, key: keyof ValidationSchemas): boolean => { const result = hasKeyMatching(value, key, this.checkKey[key]); // if (!result) { // console.log(value); // console.log(`check on [ ${key} ] failed`); // } return result; }; }