Skip to content

Commit a7ed0ba

Browse files
author
Hanna
committed
sailor 2.5.1 build type docker
1 parent 380faf7 commit a7ed0ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/actions/splitOnJsonata.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const debug = require('debug')('splitter');
21
const _ = require('lodash');
32
const { JsonataTransform } = require('@elastic.io/component-commons-library');
43
const { messages } = require('elasticio-node');
@@ -7,6 +6,7 @@ const { messages } = require('elasticio-node');
76
* @this processAction
87
*/
98
async function processAction(msg, cfg) {
9+
const self = this;
1010
const split = JsonataTransform.jsonataTransform(msg, cfg);
1111

1212
if (!Array.isArray(split)) {
@@ -21,7 +21,7 @@ async function processAction(msg, cfg) {
2121

2222
const results = [];
2323
split.forEach((elem) => results.push(elem));
24-
debug('%s parts to emit found', results.length);
24+
self.logger.debug('%s parts to emit found', results.length);
2525
results.forEach(async (result) => {
2626
if (result) {
2727
await this.emit('data', messages.newMessageWithBody(result));

0 commit comments

Comments
 (0)