Skip to content

Commit

Permalink
feat(inject): add more support for apiFormatterStr
Browse files Browse the repository at this point in the history
support comments, empty lines in the top of the string as long as it is a valid expression
  • Loading branch information
xianshenglu committed Nov 22, 2020
1 parent 27b8f40 commit 9c05aba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inject/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function init(config) {
return getApiInfo(apiOrigin, { id })
},
// eslint-disable-next-line no-new-func
formatter: new Function(`return ${apiFormatterStr.trim()}`)(),
formatter: new Function(`return (${apiFormatterStr})`)(),
})
apiCodeGen.init()

Expand Down

0 comments on commit 9c05aba

Please sign in to comment.