summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/safe-uri-decode.ts
blob: 625d8c34a77dbc7848e485f1007138cd998b585e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/*
 * SPDX-FileCopyrightText: syuilo and other misskey contributors
 * SPDX-License-Identifier: AGPL-3.0-only
 */

export function safeURIDecode(str: string): string {
	try {
		return decodeURIComponent(str);
	} catch {
		return str;
	}
}