(message, options)
| 1 | function 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 | |
| 17 | export default createError; |
no outgoing calls
no test coverage detected