Skip to content

Commit

Permalink
Fix TypeError in payload.products mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-astra-via committed Jun 10, 2024
1 parent d758505 commit d722adb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const getECParams = (event: MCEvent) => {
payload.checkout_id ||
payload.product_id ||
payload.name ||
Array.isArray(payload.products)
(Array.isArray(payload.products)
? payload.products.map((p: any) => p.name).join()

Check warning on line 54 in src/index.ts

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Unexpected any. Specify a different type
: ''
: '')
data.ev =
payload.revenue || payload.total || payload.value || payload.price
}
Expand Down

0 comments on commit d722adb

Please sign in to comment.