Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/js/dom_types.ts>URLSearchParams

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface URLSearchParams
implements DomIterable<string, string>
import { type URLSearchParams } from "https://deno.land/x/deno@v0.28.0/cli/js/dom_types.ts";

Methods

append(name: string, value: string): void

Appends a specified key/value pair as a new search parameter.

delete(name: string): void

Deletes the given search parameter, and its associated value, from the list of all search parameters.

get(name: string): string | null

Returns the first value associated to the given search parameter.

getAll(name: string): string[]

Returns all the values association with a given search parameter.

has(name: string): boolean

Returns a Boolean indicating if such a search parameter exists.

set(name: string, value: string): void

Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.

sort(): void

Sort all key/value pairs contained in this object in place and return undefined. The sort order is according to Unicode code points of the keys.

toString(): string

Returns a query string suitable for use in a URL.

forEach(callbackfn: (
value: string,
key: string,
parent: this,
) => void
, thisArg?: any
): void

Iterates over each name-value pair in the query and invokes the given function.