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

Function validateSingleRecord

src/validation-engine/validation-engine.ts:40–56  ·  view source on GitHub ↗
(
  recordId: string,
  values: any,
  schema: InternalRecordValidationSchema
)

Source from the content-addressed store, hash-verified

38 });
39
40const validateSingleRecord = (
41 recordId: string,
42 values: any,
43 schema: InternalRecordValidationSchema
44): Promise<InternalValidationResult> =>
45 !isFieldIdInSchema(recordId, schema)
46 ? Promise.resolve(createDefaultInternalValidationResult())
47 : fireSingleRecordValidations(values, schema[recordId])
48 .then((validationResult) => {
49 validationResult.key = recordId;
50 return validationResult;
51 })
52 .catch((error) => {
53 const message = `Validation Exception, record: ${recordId}`;
54 console.error(message);
55 throw error;
56 });
57
58export const validateRecord = (
59 values: any,

Callers

nothing calls this directly

Calls 3

isFieldIdInSchemaFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…