mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-06-19 20:54:59 -04:00
8 lines
247 B
TypeScript
8 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');
|
||
|
}
|