Skip to content

Commit e82fa2c

Browse files
committed
format
1 parent 2a1da12 commit e82fa2c

File tree

8 files changed

+26
-17
lines changed

8 files changed

+26
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ If you want to send emails to real addresses, you need to disable `testMode`.
6868
You can do this in `ResendOptions`, [as detailed below](#resend-component-options-and-going-into-production).
6969

7070
A note on test email addresses:
71-
[Resend allows the use of labels](https://resend.com/docs/dashboard/emails/send-test-emails#using-labels-effectively) for test emails.
71+
[Resend allows the use of labels](https://resend.com/docs/dashboard/emails/send-test-emails#using-labels-effectively) for test emails.
7272
For simplicity, this component only allows labels matching `[a-zA-Z0-9_-]*`, e.g. `[email protected]`.
7373

7474
## Advanced Usage

example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
It's a simple one. The meat is in the `convex/` directory. If you want to fire it up, here's how:
44

5-
1. Run `npm run dev`
5+
1. Run `npm run dev`
66
2. Grab a Resend api key and webhook secret and set them in your deployment environment.
77
3. Go mess around in your Convex dashboard with `testBatch`. There is no UI!

example/convex/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function handleButtonPress() {
8080
// OR
8181
// use the result once the mutation has completed
8282
mutation({ first: "Hello!", second: "me" }).then((result) =>
83-
console.log(result),
83+
console.log(result)
8484
);
8585
}
8686
```

example/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"isolatedModules": true,
1313
"allowImportingTsExtensions": true,
1414
"noEmit": true,
15-
"jsx": "react-jsx",
16-
15+
"jsx": "react-jsx"
1716
},
1817
"include": ["./src", "vite.config.ts", "./convex"]
1918
}

node10stubs.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function processSubPackages(packageJsonPath, exports, cleanup = false) {
4646
await fs.mkdir(newDir, { recursive: true });
4747
await fs.writeFile(
4848
newPackageJsonPath,
49-
JSON.stringify(newPackageJson, null, 2),
49+
JSON.stringify(newPackageJson, null, 2)
5050
);
5151
}
5252
}
@@ -71,11 +71,11 @@ async function main() {
7171

7272
if (isCleanup) {
7373
console.log(
74-
"Node10 module resolution compatibility stub directories removed.",
74+
"Node10 module resolution compatibility stub directories removed."
7575
);
7676
} else {
7777
console.log(
78-
"Node10 module resolution compatibility stub directories created",
78+
"Node10 module resolution compatibility stub directories created"
7979
);
8080
}
8181
} catch (error) {

src/component/lib.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ import { isDeepEqual } from "remeda";
2424
import schema from "./schema.js";
2525
import { omit } from "convex-helpers";
2626
import { parse } from "convex-helpers/validators";
27-
import { assertExhaustive, attemptToParse, iife, isValidResendTestEmail } from "./utils.js";
27+
import {
28+
assertExhaustive,
29+
attemptToParse,
30+
iife,
31+
isValidResendTestEmail,
32+
} from "./utils.js";
2833

2934
// Move some of these to options? TODO
3035
const SEGMENT_MS = 125;

src/component/utils.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { describe, it, expect } from "vitest";
22
import { isValidResendTestEmail } from "./utils.js";
33

44
describe("isValidResendTestEmail", () => {
5-
65
it("allows valid test emails without labels", () => {
76
expect(isValidResendTestEmail("[email protected]")).toBe(true);
87
expect(isValidResendTestEmail("[email protected]")).toBe(true);
@@ -12,10 +11,16 @@ describe("isValidResendTestEmail", () => {
1211
it("allows valid test emails with labels", () => {
1312
expect(isValidResendTestEmail("[email protected]")).toBe(true);
1413
expect(isValidResendTestEmail("[email protected]")).toBe(true);
15-
expect(isValidResendTestEmail("[email protected]")).toBe(true);
16-
expect(isValidResendTestEmail("[email protected]")).toBe(true);
14+
expect(
15+
isValidResendTestEmail("[email protected]")
16+
).toBe(true);
17+
expect(
18+
isValidResendTestEmail("[email protected]")
19+
).toBe(true);
1720
expect(isValidResendTestEmail("[email protected]")).toBe(true);
18-
expect(isValidResendTestEmail("[email protected]")).toBe(true);
21+
expect(isValidResendTestEmail("[email protected]")).toBe(
22+
true
23+
);
1924
});
2025

2126
it("rejects invalid test emails with or without labels", () => {
@@ -29,5 +34,4 @@ describe("isValidResendTestEmail", () => {
2934
expect(isValidResendTestEmail("bounced+user/[email protected]")).toBe(false);
3035
expect(isValidResendTestEmail("[email protected]")).toBe(false);
3136
});
32-
33-
});
37+
});

src/component/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ export function attemptToParse<T extends Validator<any, any, any>>(
3434
* only says "any string": https://resend.com/docs/dashboard/emails/send-test-emails#using-labels-effectively
3535
* and a full RFC-5322 compliant regex would be way too long.
3636
*/
37-
const RESEND_TEST_EMAIL_REGEX = /^(delivered|bounced|complained)(\+[a-zA-Z0-9_-]*)?@resend\.dev$/;
37+
const RESEND_TEST_EMAIL_REGEX =
38+
/^(delivered|bounced|complained)(\+[a-zA-Z0-9_-]*)?@resend\.dev$/;
3839

3940
/**
4041
* Check if the given e-mail address is a valid test e-mail for Resend.
4142
* @param email
4243
*/
4344
export function isValidResendTestEmail(email: string): boolean {
4445
return RESEND_TEST_EMAIL_REGEX.test(email);
45-
}
46+
}

0 commit comments

Comments
 (0)