ts-flex-query
Version:
Flexible and type-safe data queries
31 lines • 1.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.functionContainers = exports.publicFunctionContainers = void 0;
exports.getContainerFunctionKeys = getContainerFunctionKeys;
exports.getFunctionContainerName = getFunctionContainerName;
const aggregation_1 = require("./aggregation");
const boolean_1 = require("./boolean");
const collections_1 = require("./collections");
const comparison_1 = require("./comparison");
const internal_1 = require("./internal");
const mathematics_1 = require("./mathematics");
const text_1 = require("./text");
exports.publicFunctionContainers = {
aggregation: aggregation_1.aggregation,
boolean: boolean_1.boolean,
collections: collections_1.collections,
comparison: comparison_1.comparison,
mathematics: mathematics_1.mathematics,
text: text_1.text
};
exports.functionContainers = Object.assign(Object.assign({}, exports.publicFunctionContainers), { internal: internal_1.internal });
function getContainerFunctionKeys(container) {
return [...Object.keys(container), ...Object.getOwnPropertyNames(container)]
.filter((key) => typeof key === 'string' && typeof container[key] === 'function');
}
/** Gets the name of the given known function container, or undefined if not found. */
function getFunctionContainerName(container) {
var _a;
return (_a = Object.entries(exports.functionContainers).find((entry) => entry[1] === container)) === null || _a === void 0 ? void 0 : _a[0];
}
//# sourceMappingURL=main.js.map