Skip to content

Commit 73ad3ca

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update amaro to 0.3.0
PR-URL: #56568 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Pietro Marchini <[email protected]> Reviewed-By: Paolo Insogna <[email protected]>
1 parent 7e58da6 commit 73ad3ca

File tree

7 files changed

+309
-284
lines changed

7 files changed

+309
-284
lines changed

deps/amaro/dist/errors.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use strict";
2+
export function isSwcError(error) {
3+
return error.code !== void 0;
4+
}
5+
export function wrapAndReThrowSwcError(error) {
6+
switch (error.code) {
7+
case "UnsupportedSyntax": {
8+
const unsupportedSyntaxError = new Error(error.message);
9+
unsupportedSyntaxError.name = "UnsupportedSyntaxError";
10+
throw unsupportedSyntaxError;
11+
}
12+
case "InvalidSyntax":
13+
throw new SyntaxError(error.message);
14+
default:
15+
throw new Error(error.message);
16+
}
17+
}

0 commit comments

Comments
 (0)