Skip to content

Url.variables.deleteSearchParam

fx-fetch


fx-fetch / Url / deleteSearchParam

const deleteSearchParam: {(url, key, value?): Url; (key, value?): (url) => Url; }

Defined in: packages/fx-fetch/src/Url/deleteSearchParam.ts:57

Deletes search parameters from a Url. If a value is provided, only that value is removed; otherwise, all values for the key are removed.

(url, key, value?): Url

Deletes search parameters from a Url. If a value is provided, only that value is removed; otherwise, all values for the key are removed.

Url

string

SearchParamValueInput

Url

import { Url } from 'fx-fetch';
const url = Url.make('https://api.example.com?page=1&limit=10');
const urlWithoutParam = Url.deleteSearchParam(url, 'page');

0.1.0

(key, value?): (url) => Url

Deletes search parameters from a Url. If a value is provided, only that value is removed; otherwise, all values for the key are removed.

string

SearchParamValueInput

(url): Url

Url

Url

import { Url } from 'fx-fetch';
import { pipe } from 'effect';
const url = Url.make('https://api.example.com?page=1&limit=10');
const urlWithoutParam = pipe(
url,
Url.deleteSearchParam('page')
);

0.1.0

import { Url } from 'fx-fetch';
const url = Url.make('https://api.example.com?page=1&limit=10');
const urlWithoutParam = Url.deleteSearchParam(url, 'page');

0.1.0