CleverTap / clevertap-node

A Node.js module for accessing the CleverTap Server API
MIT License
5 stars 11 forks source link

Invalid JavaScript #11

Closed StampixSMO closed 1 year ago

StampixSMO commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch clevertap@1.2.0 for the project I'm working on.

Details

There's a missing variable declaration (or a misplaced semicolon, should be a comma). This fails in more recent JS versions since it's not actual valid JS.

Here is the diff that solved my problem:

diff --git a/node_modules/clevertap/lib/clevertap-api.js b/node_modules/clevertap/lib/clevertap-api.js
index 4d16bfd..48d5794 100644
--- a/node_modules/clevertap/lib/clevertap-api.js
+++ b/node_modules/clevertap/lib/clevertap-api.js
@@ -3,7 +3,7 @@ const request       = require('request');
 const querystring   = require('querystring');

 const API_HOSTNAME  = "api.clevertap.com";
-      API_VERSION   = 1;
+const API_VERSION   = 1;

 const CREATE = "create",
       ESTIMATE = "estimate",

This issue body was partially generated by patch-package.

StampixSMO commented 1 year ago

FYI the same is true for a variable named recordType..

KambleSonam commented 1 year ago

Hello @StampixSMO, Thank you for pointing it out. We will fix the code and release it by next week.

KambleSonam commented 1 year ago

@StampixSMO New package is released with these fixes. Thank You. Closing this issue