UNPKG

axiodb

Version:

The Pure JavaScript Alternative to SQLite. Embedded NoSQL database for Node.js with MongoDB-style queries, zero native dependencies, built-in InMemoryCache, and web GUI. Perfect for desktop apps, CLI tools, and embedded systems. No compilation, no platfor

24 lines (23 loc) 762 B
/** * Class representing a sorting utility. */ export default class Sorting { private readonly arr; private readonly query; /** * Create a Sorting instance. * @param arr - The array to be sorted. * @param query - The query object containing the sorting key and order. */ constructor(arr: any[], query: { [s: string]: unknown; } | ArrayLike<unknown>); /** * Sort the array based on the query. * Optimized for performance using native comparison operators. * @param arr - The array to be sorted. * @param query - The query object containing the sorting key and order. * @returns A promise that resolves to the sorted array. */ sort(aditionalField?: string): Promise<any[]>; }