UNPKG

nodedb-json

Version:

A lightweight JSON-based database for Node.js with TypeScript support, indexing, and complex query capabilities

6 lines 275 B
import _ from 'lodash'; export function applySort(data, sort) { const sortOptions = Array.isArray(sort) ? sort : [sort]; return _.orderBy(data, sortOptions.map(option => option.field), sortOptions.map(option => option.direction)); } //# sourceMappingURL=sorter.js.map