Skip to content

toBool

toBool(value, fallback): boolean

Defined in: core/utils/options.ts:35

Reads a boolean out of a setting that can be a boolean or the string 'true' or 'false' (from a data-* attribute).

unknown

The setting.

boolean

What to use when value is neither.

boolean

toBool('false', true); // false
toBool('maybe', true); // true