Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsonify parse -1 into undefined #2736

Open
mindon opened this issue Oct 25, 2024 · 0 comments · May be fixed by #2738
Open

jsonify parse -1 into undefined #2736

mindon opened this issue Oct 25, 2024 · 0 comments · May be fixed by #2738

Comments

@mindon
Copy link

mindon commented Oct 25, 2024

both in main and jsr:@fresh/[email protected]

here a testing case for jsonify stringify_test.ts

Deno.test("stringify - Map with", () => {
  expect(stringify({ foo: -1 }))
    .toEqual(
      '[{"foo":1},-1]',
    );
});

while testing in parse_test.ts, it failed expecting { foo: undefined }

Deno.test("parse - -1 as undefined", () => {
  expect(parse(`[{"foo":1},-1]`)).toEqual({ foo: -1 });
});

//

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant