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

Function createError

src/common/parser-create-error.js:1–15  ·  view source on GitHub ↗
(message, options)

Source from the content-addressed store, hash-verified

1function createError(message, options) {
2 // TODO: Use `Error.prototype.cause` when we drop support for Node.js<18.7.0
3
4 // Construct an error similar to the ones thrown by Babel.
5 const error = new SyntaxError(
6 message +
7 " (" +
8 options.loc.start.line +
9 ":" +
10 options.loc.start.column +
11 ")",
12 );
13
14 return Object.assign(error, options);
15}
16
17export default createError;

Callers 15

throwParseErrorFunction · 0.85
parseFunction · 0.85
parseWithParserFunction · 0.85
createJsonErrorFunction · 0.85
createParseErrorFunction · 0.85
parseFunction · 0.85
createParseErrorFunction · 0.85
createParseErrorFunction · 0.85
createParseErrorFunction · 0.85
createParseErrorFunction · 0.85
createParseErrorFunction · 0.85
createParseErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected