@hiki9/rich-domain
Version:
Rich Domain is a library that provides a set of tools to help you build complex business logic in NodeJS using Domain Driven Design principles.
19 lines • 560 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseQueryWithDots = void 0;
function parseQueryWithDots(field, verb, value) {
const fieldMap = field.split('.');
const m = {};
fieldMap.reduce((acc, curr, index) => {
if (index === fieldMap.length - 1) {
acc[curr] = { [verb]: value };
}
else {
acc[curr] = {};
}
return acc[curr];
}, m);
return m;
}
exports.parseQueryWithDots = parseQueryWithDots;
//# sourceMappingURL=parsing-filter.js.map