Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static load(config = {}) {
if (util_1.isObjectFull(config.queryParser)) {
crud_request_1.RequestQueryBuilder.setOptions(config.queryParser);
}
const query = util_1.isObjectFull(config.query) ? config.query : {};
const routes = util_1.isObjectFull(config.routes) ? config.routes : {};
const params = util_1.isObjectFull(config.params) ? config.params : {};
CrudConfigService.config = deepmerge(CrudConfigService.config, { query, routes, params }, { arrayMerge: (a, b, c) => b });
}
}
static getQueryParamsNames() {
const qbOptions = crud_request_1.RequestQueryBuilder.getOptions();
const name = (n) => qbOptions.paramNamesMap[n][0];
return {
delim: qbOptions.delim,
delimStr: qbOptions.delimStr,
fields: name('fields'),
filter: name('filter'),
or: name('or'),
join: name('join'),
sort: name('sort'),
limit: name('limit'),
offset: name('offset'),
page: name('page'),
cache: name('cache'),
};
}
}