Skip to content

Commit

Permalink
deps: update amaro to 0.3.0
Browse files Browse the repository at this point in the history
PR-URL: #56568
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
  • Loading branch information
nodejs-github-bot authored and aduh95 committed Feb 3, 2025
1 parent b47076f commit 1a4fa2b
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 284 deletions.
17 changes: 17 additions & 0 deletions deps/amaro/dist/errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";
export function isSwcError(error) {
return error.code !== void 0;
}
export function wrapAndReThrowSwcError(error) {
switch (error.code) {
case "UnsupportedSyntax": {
const unsupportedSyntaxError = new Error(error.message);
unsupportedSyntaxError.name = "UnsupportedSyntaxError";
throw unsupportedSyntaxError;
}
case "InvalidSyntax":
throw new SyntaxError(error.message);
default:
throw new Error(error.message);
}
}
Loading

0 comments on commit 1a4fa2b

Please sign in to comment.