Skip to content

@mega-yfue/eufy-sdk / asBool

Function: asBool()

ts
function asBool(value): boolean;

Coerce a property value to a boolean WITHOUT the Boolean("false") === true footgun (every non-empty string — including "false" and "0" — is truthy under Boolean()). Only an explicit true / 1 / "1" / "true" (case-insensitive) enables; everything else is false.

Parameters

value

unknown

Returns

boolean

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.