MCPcopy Index your code
hub / github.com/markdoc/markdoc / toValidateError

Function toValidateError

src/validator.ts:320–333  ·  view source on GitHub ↗
(
  node: { type: string; lines: number[]; location?: Location },
  error: ValidationError
)

Source from the content-addressed store, hash-verified

318}
319
320function toValidateError(
321 node: { type: string; lines: number[]; location?: Location },
322 error: ValidationError
323): ValidateError {
324 if (hasValidLocation(error)) {
325 return {
326 type: node.type,
327 lines: [error.location.start.line, error.location.end.line],
328 location: { file: node.location?.file, ...error.location },
329 error,
330 };
331 }
332 return { type: node.type, lines: node.lines, location: node.location, error };
333}
334
335export function validateTree(content: Node, config: Config) {
336 const output = [...walkWithParents(content)].map(([node, parents]) => {

Callers 1

validateTreeFunction · 0.85

Calls 1

hasValidLocationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…