pashto-dictionary/website/src/lib/get-word-id.ts

10 lines
227 B
TypeScript
Raw Normal View History

2024-08-14 19:30:10 +00:00
function getWordId(search: string): number | null {
const params = new URLSearchParams(search);
const id = params.get("id");
if (id) {
return parseInt(id);
}
return null;
}
export default getWordId;