Added helper file 'checkvars'
In this file comes the code to check the input from the User e.g. is `id` an integer
This commit is contained in:
1 parent
66c9dc28fc
commit
e1eaea0f17
1 file changed
+12
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export function parseInt(rawInteger){
|
||||||
|
const integer = Number.parseInt(rawInteger);
|
||||||
|
|
||||||
|
if (Number.isNaN(integer) || !Number.isInteger(integer)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return integer;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user