Socket
Book a DemoInstallSign in
Socket

url-search-params-delete

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-search-params-delete

A polyfill adding support for .delete(key,value) to URLSearchParams as discussed at https://github.com/whatwg/url/issues/335

0.2.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

url-search-params-delete

A polyfill adding support for .delete(key,value) to URLSearchParams as discussed at https://github.com/whatwg/url/issues/335

const paramsString = "foo=1&foo=2&bar=3";
const searchParams = new URLSearchParams(paramsString);
searchParams.delete("foo", "2");
console.log(searchParams.toString()); // "foo=1&bar=3"

Install the npm package url-search-params-delete and import it in your application code; a suitable location for this is usually at the top of your entry file.

import "url-search-params-delete";

The polyfill also adds support for .has(key,value) (supporting a second argument for URLSearchParams.has()).

const paramsString = "foo=1";
const searchParams = new URLSearchParams(paramsString);
searchParams.has("foo", "1"); // true
searchParams.has("foo", "2"); // false

Keywords

URLSearchParams

FAQs

Package last updated on 25 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.