Skip to content

Commit 3cffb2f

Browse files
author
Cihad Tekin
committed
[push] linting fixes
1 parent 8121d04 commit 3cffb2f

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

plugins/push/api/api-dashboard.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,29 @@ function add(from, to) {
1515
});
1616
}
1717

18+
/**
19+
* Generate event ids for event docs query
20+
* @param {string} event event name
21+
* @param {string} app_id application id
22+
* @param {number} agy ago year
23+
* @param {number} agm ago month
24+
* @param {number} noy now year
25+
* @param {number[]} mts month numbers array
26+
* @param {number} nom now month
27+
* @returns {string[]} event doc ids
28+
*/
1829
function eventIdFilter(event, app_id, agy, agm, noy, mts, nom) {
1930
const eventHash = crypto
2031
.createHash('sha1')
2132
.update(common.fixEventKey(event) + app_id)
2233
.digest('hex');
2334
const prefix = app_id + "_" + eventHash + "_";
35+
/**
36+
* Generate ids of event docs
37+
* @param {string} seg segment name
38+
* @param {string} val segment value
39+
* @returns {string[]} event doc ids
40+
*/
2441
const ids = (seg, val) => ([
2542
prefix + seg + '_' + noy + ':' + (nom + 1) + '_' + crypto.createHash('md5').update(val + '').digest('base64')[0],
2643
prefix + seg + '_' + (nom === 0 ? agy : noy) + ':' + (nom === 0 ? 12 : nom) + '_' + crypto.createHash('md5').update(val + '').digest('base64')[0]
@@ -30,7 +47,7 @@ function eventIdFilter(event, app_id, agy, agm, noy, mts, nom) {
3047
.concat(ids('a', 'true'))
3148
.concat(ids('t', 'true'))
3249
.concat(platforms.map(p => ids('ap', 'true' + p)).flat())
33-
.concat(platforms.map(p => ids('tp', 'true' + p)).flat())
50+
.concat(platforms.map(p => ids('tp', 'true' + p)).flat());
3451
}
3552

3653
/**

0 commit comments

Comments
 (0)