Improve image processing settings url target adding search parameters

This commit is contained in:
schroda
2025-12-28 02:07:52 +01:00
parent cf24b388ba
commit f9973e0ef3
8 changed files with 135 additions and 46 deletions

View File

@@ -9,6 +9,14 @@
import { SearchParam } from '@/base/Base.types.ts';
export class UrlUtil {
static asUrl(url: string): URL | null {
try {
return new URL(url);
} catch (e) {
return null;
}
}
static createParams(params: Record<SearchParam | string, string | null | undefined>): URLSearchParams {
const paramEntries = Object.entries(params).filter(
(entry): entry is [string, string] => typeof entry[1] === 'string',