UNPKG

@schamane/small-graphql-mongoose-middleware

Version:

![Check Code](https://github.com/schamane/small-graphql-mongoose-middleware/workflows/Check%20Code/badge.svg)

19 lines 637 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryHelper = void 0; const lodash_1 = require("lodash"); class QueryHelper { static packByKey(datas, key) { const fn = (data) => ({ [key]: data }); return (0, lodash_1.map)(datas, fn); } // eslint-disable-next-line @typescript-eslint/no-explicit-any static mergePush(categoryQuery, categories, key) { const result = QueryHelper.packByKey(categories, key); (0, lodash_1.merge)(categoryQuery, result); } } exports.QueryHelper = QueryHelper; //# sourceMappingURL=queryHelpers.js.map