solve some of snyk's issues with our codebase

This commit is contained in:
zkldi
2021-07-02 14:17:49 +01:00
parent 730412e3c7
commit 7397f9dccf
3 changed files with 6 additions and 8 deletions
+2 -6
View File
@@ -16,9 +16,7 @@ export function ParseStrPositiveInt(val: unknown) {
const v = Number(val);
if (!Number.isSafeInteger(v)) {
return null;
} else if (v < 0) {
if (!Number.isSafeInteger(v) || v < 0) {
return null;
}
@@ -38,9 +36,7 @@ export function ParseStrPositiveNonZeroInt(val: unknown) {
const v = Number(val);
if (!Number.isSafeInteger(v)) {
return null;
} else if (v <= 0) {
if (!Number.isSafeInteger(v) || v <= 0) {
return null;
}