Skip to content

Commit

Permalink
Temporary fix to overcome missing optional chaining support (#22)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim <>
  • Loading branch information
thim81 authored Oct 8, 2021
1 parent 2deaa0a commit befe05e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/generate/Request/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit befe05e

Please sign in to comment.