Function: consumeObject()
Call Signature
ts
function consumeObject(
key: string,
value: unknown,
nullable: true,
): LucidPlainObject | null;Consumes an object value from database results with nullable support
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The field name for error reporting |
value | unknown | The value to consume |
nullable | true | Whether the field can be null |
Returns
| LucidPlainObject | null
The consumed LucidPlainObject or null if nullable and value is null
Throws
E_INVALID_CONSUMED_VALUE when the value cannot be consumed
Call Signature
ts
function consumeObject(
key: string,
value: unknown,
nullable?: false,
): LucidPlainObject;Consumes an object value from database results with nullable support
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The field name for error reporting |
value | unknown | The value to consume |
nullable? | false | Whether the field can be null |
Returns
The consumed LucidPlainObject or null if nullable and value is null
Throws
E_INVALID_CONSUMED_VALUE when the value cannot be consumed