MCPcopy Create free account
hub / github.com/Lemoncode/fonk / validateRecord

Function validateRecord

src/validation-engine/validation-engine.ts:58–76  ·  view source on GitHub ↗
(
  values: any,
  schema: InternalRecordValidationSchema
)

Source from the content-addressed store, hash-verified

56 });
57
58export const validateRecord = (
59 values: any,
60 schema: InternalRecordValidationSchema
61): Promise<RecordValidationResult> => {
62 const promiseValidationResults = fireAllRecordsValidations(
63 safeObjectKeys(schema),
64 values,
65 schema,
66 validateSingleRecord
67 );
68
69 return Promise.all(promiseValidationResults)
70 .then((validationResults) => buildRecordValidationResult(validationResults))
71 .catch((error) => {
72 const message = 'Uncontrolled error validating records';
73 console.error(message);
74 throw error;
75 });
76};
77
78export const validateForm = (
79 values: any,

Callers 3

FormValidationClass · 0.90

Calls 3

safeObjectKeysFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…