mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
16 lines
396 B
TypeScript
16 lines
396 B
TypeScript
import { Pagination } from './types';
|
|
|
|
export default function(pagination: Pagination): string {
|
|
const sql: string[] = [];
|
|
|
|
for (let i = 0; i < pagination.order.length; i++) {
|
|
const o = pagination.order[i];
|
|
let item = `\`${o.by}\``;
|
|
if (!!o.caseInsensitive || !!pagination.caseInsensitive) item += ' COLLATE NOCASE';
|
|
item += ` ${o.dir}`;
|
|
sql.push(item);
|
|
}
|
|
|
|
return sql.join(', ');
|
|
}
|