Skip to content

Ignore empty strings breaks with numeric JSON values #12

@MadsHolten

Description

@MadsHolten

This line breaks parsing with JSON that contains numeric values:

values = values.filter((value: string): boolean => value.trim() !== '');

The following error is thrown:

TypeError: value.trim is not a function

at /app/node_modules/@comake/rmlmapper-js/dist/input-parser/SourceParser.js:27:53

at Array.filter ()

at JsonParser.getData (/app/node_modules/@comake/rmlmapper-js/dist/input-parser/SourceParser.js:27:29)

at FunctionExecutor.getValueOfReference (/app/node_modules/@comake/rmlmapper-js/dist/FunctionExecutor.js:105:34)

at FunctionExecutor.getParameterValue (/app/node_modules/@comake/rmlmapper-js/dist/FunctionExecutor.js:92:25)

at /app/node_modules/@comake/rmlmapper-js/dist/FunctionExecutor.js:81:38

at Array.map ()

at FunctionExecutor.calculateFunctionParams (/app/node_modules/@comake/rmlmapper-js/dist/FunctionExecutor.js:79:38)

at FunctionExecutor.executeFunctionFromValue (/app/node_modules/@comake/rmlmapper-js/dist/FunctionExecutor.js:17:35)

at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions