Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 32c35b5

Browse files
committed
fix: use this.constuctor.name as type
1 parent 6771f0a commit 32c35b5

File tree

4 files changed

+23
-29
lines changed

4 files changed

+23
-29
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* jslint node: true, esnext: true */
2-
"use strict";
2+
'use strict';
33

44
const Interceptor = require('./lib/interceptor').Interceptor;
55

lib/data-hash.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* jslint node: true, esnext: true */
2-
"use strict";
2+
'use strict';
33

44
const md5 = require('md5');
55

@@ -86,7 +86,7 @@ function createHashFunction(hashFields, hashName) {
8686
hashFieldValues.push(val);
8787
}
8888

89-
const valueString = hashFieldValues.join("|");
89+
const valueString = hashFieldValues.join('|');
9090
const hash = md5(valueString);
9191

9292
record[hashName] = hash;

lib/data-processor-chunk.js

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/* jslint node: true, esnext: true */
2-
"use strict";
2+
'use strict';
33

44
/**
55
* This module will turn an array of tokens into an object.
66
*/
77

88
const stream = require('stream');
99

10-
const ZSchema = require("z-schema");
10+
const ZSchema = require('z-schema');
1111
const validator = new ZSchema({});
12-
const schema = require("../schema/chunk.json");
12+
const schema = require('../schema/chunk.json');
1313

1414
const hashFactory = require('./data-hash');
1515

16-
const ERR_DOUBLE_KEY = "DOUBLE_KEY";
17-
const ERR_DOUBLE_KEY_SAME = "DOUBLE_KEY_SAME_DATA";
18-
const ERR_DOUBLE_KEY_DIFF = "DOUBLE_KEY_DIFFERENT_DATA";
16+
const ERR_DOUBLE_KEY = 'DOUBLE_KEY';
17+
const ERR_DOUBLE_KEY_SAME = 'DOUBLE_KEY_SAME_DATA';
18+
const ERR_DOUBLE_KEY_DIFF = 'DOUBLE_KEY_DIFFERENT_DATA';
1919

2020

2121

@@ -64,8 +64,6 @@ class DataProcessorChunk extends stream.Transform {
6464
}
6565
}
6666

67-
68-
6967
// Stores all the checks/action to be executed
7068
this.rowActions = hashFactory.createFunctions(opts);
7169

@@ -197,24 +195,24 @@ class DataProcessorChunk extends stream.Transform {
197195
if (row[this.contentHashName] === lastHash) {
198196
// error double key but same content
199197
addError(data, {
200-
"errorCode": ERR_DOUBLE_KEY_SAME,
201-
"severity": this.doubleKeySameContent,
202-
"doubleLines": this.keyStore[key].lineNumber
198+
errorCode: ERR_DOUBLE_KEY_SAME,
199+
severity: this.doubleKeySameContent,
200+
doubleLines: this.keyStore[key].lineNumber
203201
});
204202
} else {
205203
// error double key with different content
206204
addError(data, {
207-
"errorCode": ERR_DOUBLE_KEY_DIFF,
208-
"severity": this.doubleKeyDifferenContent,
209-
"doubleLines": this.keyStore[key].lineNumber
205+
errorCode: ERR_DOUBLE_KEY_DIFF,
206+
severity: this.doubleKeyDifferenContent,
207+
doubleLines: this.keyStore[key].lineNumber
210208
});
211209
}
212210
} else {
213211
// error double key
214212
addError(data, {
215-
"errorCode": ERR_DOUBLE_KEY,
216-
"severity": this.doubleKeySameContent,
217-
"doubleLines": this.keyStore[key].lineNumber
213+
errorCode: ERR_DOUBLE_KEY,
214+
severity: this.doubleKeySameContent,
215+
doubleLines: this.keyStore[key].lineNumber
218216
});
219217
}
220218
}
@@ -261,9 +259,9 @@ class DataProcessorChunk extends stream.Transform {
261259
if (row1.data[TMP_HASH_FIELD_NAME] !== rows[rowNum].data[TMP_HASH_FIELD_NAME]) {
262260
// the has for the other field is different. This should not be the case
263261
addError(rows[rowNum], {
264-
"errorCode": ERR_DOUBLE_KEY_DIFF,
265-
"severity": this.doubleKeyDifferenContent,
266-
"doubleLines": [row1.lineNumber, rows[rowNum].lineNumber]
262+
errorCode: ERR_DOUBLE_KEY_DIFF,
263+
severity: this.doubleKeyDifferenContent,
264+
doubleLines: [row1.lineNumber, rows[rowNum].lineNumber]
267265
});
268266
}
269267

lib/interceptor.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* jslint node: true, esnext: true */
2-
"use strict";
2+
'use strict';
33

44
const Interceptor = require('kronos-interceptor').Interceptor;
55
const parserFactory = require('./data-processor-chunk');
@@ -18,11 +18,7 @@ class ChunkProcessorInterceptor extends Interceptor {
1818
}
1919

2020
static get name() {
21-
return "data-processor-chunk";
22-
}
23-
24-
get type() {
25-
return ChunkProcessorInterceptor.name;
21+
return 'data-processor-chunk';
2622
}
2723

2824
receive(request, oldRequest) {

0 commit comments

Comments
 (0)