Closed
Description
I don't know if the {{ is what does it, but that's what I suspect. {{
is how you escape a "{" so that your string can contain a literal "{".
- Editor name and version: Github
- Platform: Web
- Color scheme: Github default color scheme
- MagicPython version: 2802ded
- A sreenshot:
- 5-10 lines of surrounding code:
def format_as_js(d, var_name, indent=0, indent_type='\t'):
yield f"{indent_type * indent}var {var_name} = {{"
for top_key, opt in d.items():
def quote(key):
return key if key.isalpha() else repr(key)
rest of the code is here: https://github.com/verhovsky/curlconverter/blob/869c6d0229a9004bdca8e44d1ef3c3227e785093/extract_curl_args.py#L201
Metadata
Metadata
Assignees
Labels
No labels