bool
constbool: (x:unknown) =>boolean=builtins.bool
Defined in: packages/pythonlib/src/index.ts:183
Convert a value to a boolean using Python’s truthiness rules.
False values: null, undefined, false, 0, empty strings, empty arrays, empty Maps/Sets.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | unknown | The value to convert |
Returns
boolean
The boolean value