Skip to main content
Module

x/pazza/examples/json.test.ts

Parser combinators library which works on browsers, Deno and Node.js.
Latest
File
import { test, expect } from 'vitest'import { jsonValue } from './json'
test('jsonParser', () => { const result = jsonValue()(` [ 2, -43.21, true, "test", "\\n\\"\\t", false, { "a": "b", "c": null } ] `)
expect(result).toEqual({ ok: true, input: '\n ', output: [ 2, -43.21, true, 'test', '\n"\t', false, { a: 'b', c: null, }, ], context: {}, })})