(value: QueryValue, fallback?: string)
| 141 | export function decodeSorts(value: QueryValue): Sort[]; |
| 142 | export function decodeSorts(value: QueryValue, fallback: string): Sort[]; |
| 143 | export function decodeSorts(value: QueryValue, fallback?: string): Sort[] { |
| 144 | const sorts = decodeList(value).filter(Boolean); |
| 145 | if (!sorts.length) { |
| 146 | return fallback ? decodeSorts(fallback) : []; |
| 147 | } |
| 148 | return sorts.map(sort => |
| 149 | sort.startsWith('-') |
| 150 | ? {kind: 'desc', field: sort.substring(1)} |
| 151 | : {kind: 'asc', field: sort} |
| 152 | ); |
| 153 | } |
| 154 | |
| 155 | export function decodeBoolean(value: QueryValue): boolean | undefined; |
| 156 | export function decodeBoolean(value: QueryValue, fallback: boolean): boolean; |
no test coverage detected