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

Commit d45934d

Browse files
author
Torsten Link
committed
perf(validation): Moved the validation of the config into the contractor, so it will be validated only once
1 parent e7515d3 commit d45934d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/interceptor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class ChunkProcessorInterceptor extends Interceptor {
1212

1313
constructor(endpoint, config) {
1414
super(endpoint, config);
15+
16+
// just validate the config once
17+
parserFactory(config, true);
1518
}
1619

1720
static get type() {
@@ -24,7 +27,7 @@ class ChunkProcessorInterceptor extends Interceptor {
2427

2528
receive(request, oldRequest) {
2629
if (request.payload) {
27-
const streamFilter = parserFactory(this.config, true);
30+
const streamFilter = parserFactory(this.config);
2831
const stream = request.payload;
2932
request.payload = stream.pipe(streamFilter);
3033
}

0 commit comments

Comments
 (0)