mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 13:14:48 +00:00
Add node querystring polyfill (#4370)
This commit is contained in:
parent
92bbce04b9
commit
9648d3da14
4 changed files with 106 additions and 1 deletions
30
std/node/querystring_test.ts
Normal file
30
std/node/querystring_test.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
const { test } = Deno;
|
||||
import { assertEquals } from "../testing/asserts.ts";
|
||||
import { stringify, parse } from "./querystring.ts";
|
||||
|
||||
test({
|
||||
name: "stringify",
|
||||
fn() {
|
||||
assertEquals(
|
||||
stringify({
|
||||
a: "hello",
|
||||
b: 5,
|
||||
c: true,
|
||||
d: ["foo", "bar"]
|
||||
}),
|
||||
"a=hello&b=5&c=true&d=foo&d=bar"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test({
|
||||
name: "parse",
|
||||
fn() {
|
||||
assertEquals(parse("a=hello&b=5&c=true&d=foo&d=bar"), {
|
||||
a: "hello",
|
||||
b: "5",
|
||||
c: "true",
|
||||
d: ["foo", "bar"]
|
||||
});
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue