(node, description)
| 71 | } |
| 72 | |
| 73 | function 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 | |
| 85 | function assertJsonNode(node) { |
| 86 | switch (node.type) { |
no test coverage detected