ft_transcendence/frontend/src/utils.ts
Maieul BOYER 08c910c193 feat(frontend): added frontend
- Router: client side route handling with client side rendering
- Toast: rought Toast handling for better UX and messaging
- Auth: single point of truth for the Logged in user

This commit doesnt not include the openapi generated code
2025-11-11 00:20:26 +01:00

8 lines
281 B
TypeScript

export function escapeHTML(str: string): string {
const p = document.createElement("p");
p.appendChild(document.createTextNode(str));
return p.innerHTML;
}
export function isNullish<T>(v: T | undefined | null): v is (null | undefined) {
return v === null || v === undefined;
}