mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-06-19 20:54:59 -04:00

* feat(new tool): Outlook Safelink Decoder Fix #897 * Use native URL parsing Co-authored-by: Corentin THOMASSET <corentin.thomasset74@gmail.com> * Update src/tools/safelink-decoder/index.ts --------- Co-authored-by: Corentin THOMASSET <corentin.thomasset74@gmail.com>
7 lines
247 B
TypeScript
7 lines
247 B
TypeScript
export function decodeSafeLinksURL(safeLinksUrl: string) {
|
|
if (!safeLinksUrl.match(/\.safelinks\.protection\.outlook\.com/)) {
|
|
throw new Error('Invalid SafeLinks URL provided');
|
|
}
|
|
|
|
return new URL(safeLinksUrl).searchParams.get('url');
|
|
}
|