mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2024-06-26 17:30:01 +02:00
20 lines
533 B
TypeScript
20 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;
|
||
|
}
|
||
|
}
|