query.toOrderOptions() function
Turns a serialized order into Sequelize's order option.
Signature:
export function toOrderOptions<_T>(orderBy?: OrderByInput): FindOptions;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
orderBy |
(Optional) Property-to-direction map from the caller. |
Returns:
FindOptions
Options carrying order, or empty options.
Remarks
One entry per property, in the order the object lists them, so the caller controls precedence. Directions are normalised rather than trusted — anything that does not read as descending becomes ascending, which is what keeps a value off the wire out of the statement. An empty or absent order yields no order at all rather than an empty one.