MCPcopy Create free account
hub / github.com/prettier/prettier / createJsonError

Function createJsonError

src/language-json/parse/json.js:73–83  ·  view source on GitHub ↗
(node, description)

Source from the content-addressed store, hash-verified

71}
72
73function createJsonError(node, description) {
74 const [start, end] = [node.loc.start, node.loc.end].map(
75 ({ line, column }) => ({
76 line,
77 column: column + 1,
78 }),
79 );
80 return createError(`${description} is not allowed in JSON.`, {
81 loc: { start, end },
82 });
83}
84
85function assertJsonNode(node) {
86 switch (node.type) {

Callers 2

parseJsonFunction · 0.85
assertJsonNodeFunction · 0.85

Calls 2

createErrorFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected