mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2025-01-08 20:31:31 +01:00
19 lines
533 B
TypeScript
19 lines
533 B
TypeScript
export default class LienHelper {
|
|
public static extraireInformation(cle: string): string | null {
|
|
if (window.location.hash === "" || window.location.hash === "#") return null;
|
|
|
|
let hashPart = atob(window.location.hash.substring(1)).split("/");
|
|
for (let infoPos in hashPart) {
|
|
let info = hashPart[infoPos];
|
|
if (!info.includes("=")) continue;
|
|
let infoPart = info.split("=");
|
|
let infoKey = infoPart[0];
|
|
|
|
if (infoKey !== cle) continue;
|
|
|
|
return infoPart[1];
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|