Skip to content

Commit

Permalink
😎 Autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
omrilotan committed Nov 29, 2023
1 parent 5c49a6b commit dbc63e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This small tool is meant to mitigate this gap.
import { decode } from "react-error-decoder";

decode(
"Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
"Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.",
);

// Output:
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function decodeDetails(message: string): {

if (!collection[invariant]) {
throw new RangeError(
`Collection does not include invariant "${invariant}"`
`Collection does not include invariant "${invariant}"`,
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("react-error-decoder", (): void => {
"NGABuilder(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.",
],
])("decodes messages successfully", (input: string, message: string): void =>
expect(decode(input)).toBe(message)
expect(decode(input)).toBe(message),
);
test("Leave an error not in dictionary as is", (): void => {
const input =
Expand All @@ -45,7 +45,7 @@ describe("react-error-decoder", (): void => {
"Minified React error #1: Something else has gone wrong. https://www.facebook.com",
"Minified React error #1: Something else has gone wrong. https://www.facebook.com?invariant=900",
])("falls back to original message", (message: string): void =>
expect(decode(message)).toBe(message)
expect(decode(message)).toBe(message),
);
test("updated snapshot", (): void =>
expect(decode.collection).toMatchSnapshot());
Expand Down

0 comments on commit dbc63e9

Please sign in to comment.