Skip to content

Commit 2baba4f

Browse files
committed
lint
1 parent c9d4e82 commit 2baba4f

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ module.exports = {
8383
"always"
8484
],
8585
"no-multi-spaces": [
86-
"error"
86+
"warn"
8787
],
8888
"no-trailing-spaces": [
89-
"error",
89+
"warn",
9090
{
9191
"ignoreComments": true
9292
}

lib/countly-bulk.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ function CountlyBulk(conf) {
197197
query.hour = query.hour || date.getHours();
198198
query.dow = query.dow || date.getDay();
199199
query.tz = query.tz || -date.getTimezoneOffset();
200-
cc.log(cc.logLevelEnums.INFO, "CountlyBulk add_bulk_request, adding the request into queue:["+ JSON.stringify(query) + "]");
200+
cc.log(cc.logLevelEnums.INFO, `CountlyBulk add_bulk_request, adding the request into queue: [${JSON.stringify(query)}]`);
201201
requestQueue.push(query);
202202
}
203203
CountlyStorage.storeSet("cly_req_queue", requestQueue);

lib/countly.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ Countly.Bulk = Bulk;
850850
user.custom = cc.truncateObject(user.custom, Countly.maxKeyLength, Countly.maxValueSize, Countly.maxSegmentationValues, "user_details");
851851
var request = { user_details: JSON.stringify(cc.getProperties(user, props)) };
852852
if (!user.picture && user.picturePath) {
853-
cc.log(cc.logLevelEnums.INFO, "user_details, Picture is not set but picturePath is set, will try to upload picture from path.");
853+
cc.log(cc.logLevelEnums.INFO, "user_details, Picture is not set but picturePath is set, will try to upload picture from path.");
854854
request.picturePath = user.picturePath;
855855
}
856856
toRequestQueue(request);
@@ -1658,16 +1658,22 @@ Countly.Bulk = Bulk;
16581658
var fileName = path.basename(filePath);
16591659
var ext = (fileName.split('.').pop() || '').toLowerCase();
16601660
var contentType = 'application/octet-stream';
1661-
if (ext === 'png') contentType = 'image/png';
1662-
else if (ext === 'jpg' || ext === 'jpeg') contentType = 'image/jpeg';
1663-
else if (ext === 'gif') contentType = 'image/gif';
1661+
if (ext === 'png') {
1662+
contentType = 'image/png';
1663+
} else if (ext === 'jpg' || ext === 'jpeg') {
1664+
contentType = 'image/jpeg';
1665+
} else if (ext === 'gif') {
1666+
contentType = 'image/gif';
1667+
}
16641668

16651669
var boundary = 'FormBoundary' + Math.random().toString(16).slice(2);
16661670
var bodyParts = [];
16671671

16681672
for (var p in params) {
16691673
if (!Object.prototype.hasOwnProperty.call(params, p)) continue;
1670-
if (p === 'picturePath') continue;
1674+
if (p === 'picturePath') {
1675+
continue;
1676+
}
16711677
var value = params[p];
16721678
bodyParts.push(Buffer.from(`--${boundary}\r\n`));
16731679
bodyParts.push(Buffer.from(`Content-Disposition: form-data; name="${p}"\r\n\r\n`));
@@ -1689,7 +1695,7 @@ Countly.Bulk = Bulk;
16891695
options.method = "POST";
16901696
options.path = api;
16911697
options.headers = options.headers || {};
1692-
options.headers['Content-Type'] = 'multipart/form-data; boundary=' + boundary;
1698+
options.headers['Content-Type'] = `multipart/form-data; boundary=${boundary}`;
16931699
options.headers['Content-Length'] = data.length;
16941700
}
16951701
catch (e) {

0 commit comments

Comments
 (0)