import { fn } from "https://deno.land/x/ddc_vim@v0.0.12/deps.ts";
const { json_encode } = fn;
Encode {expr} as JSON and return this as a string. The encoding is specified in: https://tools.ietf.org/html/rfc7159.html Vim values are converted as follows: |Number| decimal number |Float| floating point number Float nan "NaN" Float inf "Infinity" Float -inf "-Infinity" |String| in double quotes (possibly null) |Funcref| not possible, error |List| as an array (possibly null); when used recursively: [] |Dict| as an object (possibly null); when used recursively: {} |Blob| as an array of the individual bytes v:false "false" v:true "true" v:none "null" v:null "null" Note that NaN and Infinity are passed on as values. This is missing in the JSON standard, but several implementations do allow it. If not then you will get an error. Can also be used as a |method|: GetObject()->json_encode()