mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-24 17:11:49 +00:00
feat: add real param validation for applicationId
This commit is contained in:
parent
a55d2e2ff8
commit
0516bf2a1a
1 changed files with 4 additions and 2 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
import type { ParamMatcher } from '@sveltejs/kit';
|
import type { ParamMatcher } from '@sveltejs/kit';
|
||||||
|
|
||||||
export const match: ParamMatcher = (param) => {
|
export const match: ParamMatcher = (param) => {
|
||||||
//TODO: Application regex
|
const isNumber = /^\d{6}(?:\d{1})?$/.test(param);
|
||||||
return /^\d+$/.test(param);
|
const isValid = param.startsWith('101') || param.startsWith('102') || param.startsWith('103');
|
||||||
|
|
||||||
|
return isNumber && isValid;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue