In this file comes the code to check the input from the User e.g. is `id` an integer
13 lines
223 B
TypeScript
13 lines
223 B
TypeScript
|
|
|
|
export function parseInt(rawInteger){
|
|
const integer = Number.parseInt(rawInteger);
|
|
|
|
if (Number.isNaN(integer) || !Number.isInteger(integer)) {
|
|
return null;
|
|
}
|
|
else {
|
|
return integer;
|
|
}
|
|
}
|