mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
fix HubError type check
This commit is contained in:
@@ -35,10 +35,7 @@ export enum HubError {
|
||||
}
|
||||
|
||||
function isHubError(arg: unknown): arg is HubError {
|
||||
if (typeof arg !== 'string') {
|
||||
return false;
|
||||
}
|
||||
return Object.keys(HubError).includes(arg);
|
||||
return Object.values(HubError).includes(arg as HubError);
|
||||
}
|
||||
|
||||
export enum FailToFinishReasonType {
|
||||
|
||||
Reference in New Issue
Block a user