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

Function createParseError

src/language-js/parse/angular.js:15–32  ·  view source on GitHub ↗

@import {TupleTypeAnnotation} from "@babel/types"

(error)

Source from the content-addressed store, hash-verified

13*/
14
15function createParseError(error) {
16 /* c8 ignore next 3 */
17 if (!error?.location) {
18 return error;
19 }
20
21 const {
22 message,
23 location: { line, col: column },
24 } = error;
25
26 return createError(message, {
27 loc: {
28 start: { line: line + 1, column: Math.max(column, 1) },
29 },
30 cause: error,
31 });
32}
33
34/**
35@typedef {

Callers 1

parseFunction · 0.70

Calls 1

createErrorFunction · 0.85

Tested by

no test coverage detected