From 3333c721dffb76a68ae493161b70ddc6e98421ee Mon Sep 17 00:00:00 2001 From: Tim <> Date: Fri, 8 Oct 2021 18:09:29 +0200 Subject: [PATCH] Temporary fix to overcome missing optional chaining support --- lib/generate/Request/config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/generate/Request/config.js b/lib/generate/Request/config.js index c627930..1c26a3a 100644 --- a/lib/generate/Request/config.js +++ b/lib/generate/Request/config.js @@ -182,8 +182,14 @@ ${aid.indent(pre.join('\n'))} function renderPost(post) { if (post.length) { + // TODO REMOVE FIX FOR UNSAFE OPTIONAL CHAINING CONVERSION - ORG CODE + // Linked to K6 issue: https://github.com/grafana/k6/issues/2168 + // return `post(response) { +// ${aid.indent(post.join('\n'))} +// }`; + // TODO REMOVE FIX FOR UNSAFE OPTIONAL CHAINING CONVERSION - FIX return `post(response) { -${aid.indent(post.join('\n'))} +${aid.indent(post.join('\n').replace(/\?\.\[/g, '[').replace(/\?\./g, '.'))} }`; } else { return null;