MCPcopy
hub / github.com/github/awesome-copilot / getFieldSchemaForSection

Function getFieldSchemaForSection

extensions/site-studio/extension.mjs:448–461  ·  view source on GitHub ↗
(sectionId, field)

Source from the content-addressed store, hash-verified

446}
447
448function getFieldSchemaForSection(sectionId, field) {
449 if (!stateCache?.sectionSchemas || typeof stateCache.sectionSchemas !== "object") {
450 return null;
451 }
452 const sectionSchema = stateCache.sectionSchemas[sectionId];
453 if (!sectionSchema || typeof sectionSchema !== "object") {
454 return null;
455 }
456 const fieldSchema = sectionSchema[field];
457 if (!fieldSchema || typeof fieldSchema !== "object") {
458 return null;
459 }
460 return fieldSchema;
461}
462
463function isValidEmail(value) {
464 return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);

Callers 1

validateFieldValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected