Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit b89a13c

Browse files
committed
chore: do not reassign result
1 parent 0709909 commit b89a13c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class Subscriptions {
344344
return payments //
345345
.sort((a, b) => new Date(a.event_time).getTime() - new Date(b.event_time).getTime())
346346
.map(payment => {
347-
let result = {
347+
const result = {
348348
event_time: payment.event_time,
349349
description: payment.alert_name,
350350
amount: {
@@ -356,14 +356,14 @@ class Subscriptions {
356356
subscription_plan_id: payment.subscription_plan_id,
357357
}
358358
if (payment.alert_name === 'subscription_payment_failed') {
359-
result = Object.assign(result, {
359+
Object.assign(result, {
360360
next_try: {
361361
date: payment.next_retry_date
362362
},
363363
instalments: payment.instalments,
364364
})
365365
} else if (payment.alert_name === 'subscription_payment_refunded') {
366-
result = Object.assign(result, {
366+
Object.assign(result, {
367367
refund: {
368368
reason: payment.refund_reason,
369369
type: payment.refund_type
@@ -372,7 +372,7 @@ class Subscriptions {
372372
})
373373
result.amount.total = payment.gross_refund
374374
} else if (payment.alert_name === 'subscription_payment_succeeded') {
375-
result = Object.assign(result, {
375+
Object.assign(result, {
376376
next_payment: {
377377
date: payment.next_bill_date,
378378
amount: {

0 commit comments

Comments
 (0)