Diff
Readable additions and removals in a change set.
Diff
src/checkout.ts
+4−4@@ −3 +3 @@ | |||
| 3 | 3 | export async function checkout(cart: Cart) { | |
| 4 | |||
| 5 | |||
| 6 | |||
| 4 | const total = cart.items.reduce((sum, item) => sum + item.price * item.quantity, 0) | ||
| 5 | if (total <= 0) return null | ||
| 6 | const receipt = await charge(cart.customer, total, { idempotencyKey: cart.id }) | ||
| 7 | 7 | log("charged", total) | |
@@ −11 +11 @@ | |||
| 11 | 11 | function log(event: string, value: number) { | |
| 12 | |||
| 12 | metrics.increment(event, value) | ||
| 13 | 13 | } | |
Side by side
+4−4@@ −3 +3 @@ | |||
| 3 | export async function checkout(cart: Cart) { | 3 | export async function checkout(cart: Cart) { |
| 4 | 4 | const total = cart.items.reduce((sum, item) => sum + item.price * item.quantity, 0) | |
| 5 | 5 | if (total <= 0) return null | |
| 6 | 6 | const receipt = await charge(cart.customer, total, { idempotencyKey: cart.id }) | |
| 7 | log("charged", total) | 7 | log("charged", total) |
@@ −11 +11 @@ | |||
| 11 | function log(event: string, value: number) { | 11 | function log(event: string, value: number) { |
| 12 | 12 | metrics.increment(event, value) | |
| 13 | } | 13 | } |
Step 3: Filter
+1−1| Only continue if the email subject contains "invoice" or "receipt". |
| Send the attachment to the finance folder. |
How it works
Line diff with the changed words marked inside each line (<del> and <ins>). Hunks accept or reject one by one where the product allows; unchanged stretches fold.
Installation
npx shadcn@latest add checkfu/uicontext/diff