refactor(core): fix for no-uncaught-json-parse warnings

This commit is contained in:
Michael Kret
2022-10-21 21:52:43 +03:00
committed by GitHub
parent ca9eca9ae9
commit 1d57b10942
36 changed files with 150 additions and 93 deletions

View File

@@ -4,6 +4,7 @@ import {
IN8nHttpFullResponse,
INodeExecutionData,
INodeProperties,
jsonParse,
} from 'n8n-workflow';
export const questionsOperations: INodeProperties[] = [
@@ -74,9 +75,7 @@ export const questionsOperations: INodeProperties[] = [
}
items[i] = newItem;
if (this.getNode().parameters.format === 'json') {
items[i].json = JSON.parse(
items[i].json as unknown as string,
)[0] as unknown as IDataObject;
items[i].json = jsonParse<IDataObject[]>(items[i].json as unknown as string)[0];
console.log(items[i].json);
delete items[i].binary;
} else {