@fincity/kirun-js 1.4.8 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,29 +15,32 @@ test('toString test1', async () => {
15
15
  expect((await toString.execute(fep)).allResults()[0].getResult().get('result')).toBe('123');
16
16
  });
17
17
 
18
- // test('toString test2', async () => {
19
- // let fep: FunctionExecutionParameters = new FunctionExecutionParameters(new KIRunFunctionRepository(), new KIRunSchemaRepository());
20
-
21
- // let array: string[] = [];
22
- // array.push('I');
23
- // array.push('am');
24
- // array.push('using');
25
- // array.push('eclipse');
26
- // array.push('to');
27
- // array.push('test');
28
- // array.push('the');
29
- // array.push('changes');
30
- // array.push('with');
31
- // array.push('test');
32
- // array.push('Driven');
33
- // array.push('developement');
34
-
35
- // fep.setArguments(MapUtil.of('anytype', array));
36
-
37
- // expect((await toString.execute(fep)).allResults()[0].getResult().get('result')).toBe(
38
- // 'I am using eclipse to test the changes with test Driven developement',
39
- // );
40
- // });
18
+ test('toString test2', async () => {
19
+ let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
20
+ new KIRunFunctionRepository(),
21
+ new KIRunSchemaRepository(),
22
+ );
23
+
24
+ let array: string[] = [];
25
+ array.push('I');
26
+ array.push('am');
27
+ array.push('using');
28
+ array.push('eclipse');
29
+ array.push('to');
30
+ array.push('test');
31
+ array.push('the');
32
+ array.push('changes');
33
+ array.push('with');
34
+ array.push('test');
35
+ array.push('Driven');
36
+ array.push('developement');
37
+
38
+ fep.setArguments(MapUtil.of('anytype', array));
39
+
40
+ expect((await toString.execute(fep)).allResults()[0].getResult().get('result')).toBe(
41
+ '["I","am","using","eclipse","to","test","the","changes","with","test","Driven","developement"]',
42
+ );
43
+ });
41
44
 
42
45
  test('toString test2 ', async () => {
43
46
  let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fincity/kirun-js",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "Javascript Runtime for Kinetic Instructions",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -40,7 +40,13 @@ export class ToString extends AbstractFunction {
40
40
 
41
41
  protected async internalExecute(context: FunctionExecutionParameters): Promise<FunctionOutput> {
42
42
  let input: any = context.getArguments()?.get(this.PARAMETER_INPUT_ANYTYPE_NAME);
43
- let output: string = input + '';
43
+ let output: string = '';
44
+
45
+ if (typeof input === 'object') {
46
+ output = JSON.stringify(input, undefined, 2);
47
+ } else {
48
+ output = '' + input;
49
+ }
44
50
 
45
51
  return new FunctionOutput([
46
52
  EventResult.outputOf(new Map([[this.EVENT_RESULT_NAME, output]])),