jiphy icon indicating copy to clipboard operation
jiphy copied to clipboard

Variable args not converted properly

Open mikaelho opened this issue 6 years ago • 1 comments

Python function *args should convert to JS ...args.

mikaelho avatar Mar 10 '18 06:03 mikaelho

This is a bit old, but this issue appears when using jiphy for JS to Python conversion as well. For anyone else who runs into this issue, I found a quick workaround: Add an extra set of escaped brackets around the arguments (but within the parenthesis) via regex immediately prior to jiphy conversion.

E.g. function myFunctionName(arg1, arg2){ --> function myFunctionName((arg1, arg2)){

regex: find: /function ([a-zA-z]+)((.*?))/ replace: /function $1(\($2\))/

jwest75674 avatar Aug 16 '19 13:08 jwest75674