MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / validateRequired

Function validateRequired

tests/testSchemas.js:7–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5const isObject = a => !!a && a.constructor === Object;
6
7const validateRequired = obj => {
8 const errors = validateRequiredRecursive(obj);
9 if (errors.length === 0) return null;
10 return errors;
11};
12
13const validateRequiredRecursive = (obj, path = '') => {
14 if (!isObject(obj)) return [];

Callers 1

testSchemas.jsFile · 0.85

Calls 1

Tested by

no test coverage detected