UNPKG

@cashfarm/lang

Version:

Extends TypeScript/Javascript with basic classes and functions

15 lines 512 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const enums_1 = require("./enums"); const util_1 = require("./util"); function Sortable(Base) { return class extends Base { byProperty(prop, order = enums_1.OrderDirection.Asc) { const expr = typeof prop === 'string' ? () => this[prop] : prop; this.sort(util_1.makeCompareFn(expr, order)); return this; } }; } exports.Sortable = Sortable; //# sourceMappingURL=sortable.js.map