Home > widget-integration > FilterUrlHelper > applyParamOperation

FilterUrlHelper.applyParamOperation() method

Applies parameter operation to URL (set or append).

Handles both single values and arrays, with optional force-append mode. Override this method to customize how parameters are added to URLs.

Signature:

protected applyParamOperation(url: URL, key: string, value: string | string[], options?: {
		forceAppend?: boolean;
	}): void;

Parameters

Parameter

Type

Description

url

URL

URL object to modify in place

key

string

The parameter key to set

value

string | string[]

The value(s) to set. Single string or array of strings

options

{ forceAppend?: boolean; }

(Optional) Configuration options

Returns:

void

Example

Add parameter deduplication:

protected applyParamOperation(
  url: URL,
  key: string,
  value: string | string[],
  options: { forceAppend?: boolean } = {}
): void {
  // Remove duplicates before applying
  const values = Array.isArray(value) ? [...new Set(value)] : [value];
  super.applyParamOperation(url, key, values, options);
}