import { stringifySfv } from "https://deno.land/x/sfv_parser@1.1.0/stringify.ts";
Serialize Sfv into string.
Examples
Example 1
Example 1
import { stringifySfv } from "https://deno.land/x/sfv_parser@$VERSION/mod.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
const sfv = {
"type": "List",
"value": [
{
"type": "Item",
"value": [
{ "type": "Token", "value": "sugar" },
{ "type": "Parameters", "value": [] },
],
},
{
"type": "Item",
"value": [
{ "type": "Token", "value": "tea" },
{ "type": "Parameters", "value": [] },
],
},
{
"type": "Item",
"value": [
{ "type": "Token", "value": "rum" },
{ "type": "Parameters", "value": [] },
],
},
],
} as const;
assertEquals(stringifySfv(sfv), "sugar, tea, rum");