Sqlite upgrade and type refactorings
This commit is contained in:
parent
01691a0c20
commit
28c8429edd
20 changed files with 873 additions and 663 deletions
|
|
@ -17,7 +17,11 @@ export function normalizeMac (mac: string): string {
|
|||
return macParts.join(':');
|
||||
}
|
||||
|
||||
export function parseInteger (str: string): number | undefined {
|
||||
export function parseInteger (str: string): number {
|
||||
const parsed = _.parseInt(str, 10);
|
||||
return parsed.toString() === str ? parsed : undefined;
|
||||
if (parsed.toString() === str) {
|
||||
return parsed;
|
||||
} else {
|
||||
throw new SyntaxError(`String does not represent a valid integer: "${str}"`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue