Add TypeChecker and use its methods wherever possible.
This commit is contained in:
13
config-serializer/TypeChecker.ts
Normal file
13
config-serializer/TypeChecker.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
class TypeChecker {
|
||||
|
||||
static firstValidScancode = 1;
|
||||
static lastValidScancode = 231;
|
||||
|
||||
static isUInt8Valid(uint8: number): boolean {
|
||||
return 0 <= uint8 && uint8 <= 255;
|
||||
}
|
||||
|
||||
static isScancodeValid(scancode: number): boolean {
|
||||
return TypeChecker.firstValidScancode <= scancode && scancode <= TypeChecker.lastValidScancode;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user