Files
solana/explorer/src/utils.ts
2020-06-12 16:32:05 -07:00

17 lines
414 B
TypeScript

export function findGetParameter(parameterName: string): string | null {
let result = null,
tmp = [];
window.location.search
.substr(1)
.split("&")
.forEach(function(item) {
tmp = item.split("=");
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
});
return result;
}
export function assertUnreachable(x: never): never {
throw new Error("Unreachable!");
}