Skip to content

Commit

Permalink
fix: unavailable boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoim committed Jan 19, 2023
1 parent 2ed8ad0 commit 0c13525
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion reactive_home/src/lib/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export type BooleanStates = boolean | "on" | "off";

export function stringBoolToBool(state: BooleanStates | string) {
return state === "on" ? true : state === "off" ? false : !!state;
return state === "on"
? true
: state === "off"
? false
: state === "unavailable"
? false
: !!state;
}

0 comments on commit 0c13525

Please sign in to comment.