Skip to content

Commit 87ee9c9

Browse files
committed
lnt fixes
1 parent 22aeb78 commit 87ee9c9

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

lib/utils/unsafeFields.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { GroupedEventDBScheme, RepetitionDBScheme as RepetitionDBSchemeType } fr
22

33
type RepetitionDBScheme = Omit<RepetitionDBSchemeType, 'payload'> & Partial<Pick<RepetitionDBSchemeType, 'payload'>>;
44

5-
65
/**
76
* Fields in event payload with unsafe data for encoding before saving in database
87
*/
@@ -62,7 +61,6 @@ export function encodeUnsafeFields(event: GroupedEventDBScheme | RepetitionDBSch
6261
if (fieldValue === undefined) {
6362
return;
6463
}
65-
6664

6765
let newValue: string;
6866

lib/worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export abstract class Worker {
359359

360360
return;
361361
default:
362-
console.error(e)
362+
console.error(e);
363363
this.logger.error('Unknown error: ', e);
364364
await this.sendToStash(msg);
365365
}

workers/grouper/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"private": true,
1010
"workerType": "grouper",
1111
"dependencies": {
12+
"@types/redis": "^2.8.28",
1213
"@n1ru4l/json-patch-plus": "^0.2.0",
1314
"js-levenshtein": "^1.1.6"
1415
}

workers/grouper/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import './env';
22
import * as crypto from 'crypto';
33
import * as mongodb from 'mongodb';
44
import { DatabaseController } from '../../../lib/db/controller';
5-
import * as utils from '../../../lib/utils';
65
import { Worker } from '../../../lib/worker';
76
import * as WorkerNames from '../../../lib/workerNames';
87
import * as pkg from '../package.json';

workers/grouper/tests/mocks/randomId.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
* Returns random string
33
*/
44
export function generateRandomId(): string {
5-
return Math.random().toString(36)
6-
.substring(2, 15) + Math.random().toString(36)
7-
.substring(2, 15);
5+
const FIRST_RANDOM_START = 2;
6+
const FIRST_RANDOM_END = 15;
7+
const RADIX = 36;
8+
9+
return Math.random().toString(RADIX)
10+
.substring(FIRST_RANDOM_START, FIRST_RANDOM_END) + Math.random().toString(RADIX)
11+
.substring(FIRST_RANDOM_START, FIRST_RANDOM_END);
812
}

0 commit comments

Comments
 (0)