Comparing version
@@ -41,4 +41,4 @@ "use strict"; | ||
const value = (_a = input[constants_1.Parameter.RELATIONS]) !== null && _a !== void 0 ? _a : input[constants_1.URLParameter.RELATIONS]; | ||
if (value || options[constants_1.Parameter.RELATIONS]) { | ||
relations = (0, parameter_1.parseQueryParameter)(key, value, options[constants_1.Parameter.RELATIONS]); | ||
if (value && (0, parameter_1.isQueryParameterEnabled)(options[constants_1.Parameter.RELATIONS])) { | ||
relations = (0, parameter_1.parseQueryParameter)(key, value, (0, parameter_1.buildQueryParameterOptions)(options[constants_1.Parameter.RELATIONS])); | ||
output[constants_1.Parameter.RELATIONS] = relations; | ||
@@ -50,4 +50,4 @@ } | ||
const value = (_b = input[constants_1.Parameter.FIELDS]) !== null && _b !== void 0 ? _b : input[constants_1.URLParameter.FIELDS]; | ||
if (value || options[constants_1.Parameter.FIELDS]) { | ||
output[constants_1.Parameter.FIELDS] = (0, parameter_1.parseQueryParameter)(key, value, mergeWithGlobalOptions(options[constants_1.Parameter.FIELDS]), relations); | ||
if (value && (0, parameter_1.isQueryParameterEnabled)(options[constants_1.Parameter.FIELDS])) { | ||
output[constants_1.Parameter.FIELDS] = (0, parameter_1.parseQueryParameter)(key, value, mergeWithGlobalOptions((0, parameter_1.buildQueryParameterOptions)(options[constants_1.Parameter.FIELDS])), relations); | ||
} | ||
@@ -58,4 +58,4 @@ break; | ||
const value = (_c = input[constants_1.Parameter.FILTERS]) !== null && _c !== void 0 ? _c : input[constants_1.URLParameter.FILTERS]; | ||
if (value || options[constants_1.Parameter.FILTERS]) { | ||
output[constants_1.Parameter.FILTERS] = (0, parameter_1.parseQueryParameter)(key, value, mergeWithGlobalOptions(options[constants_1.Parameter.FILTERS]), relations); | ||
if (value && (0, parameter_1.isQueryParameterEnabled)(options[constants_1.Parameter.FILTERS])) { | ||
output[constants_1.Parameter.FILTERS] = (0, parameter_1.parseQueryParameter)(key, value, mergeWithGlobalOptions((0, parameter_1.buildQueryParameterOptions)(options[constants_1.Parameter.FILTERS])), relations); | ||
} | ||
@@ -66,4 +66,4 @@ break; | ||
const value = (_d = input[constants_1.Parameter.PAGINATION]) !== null && _d !== void 0 ? _d : input[constants_1.URLParameter.PAGINATION]; | ||
if (value || options[constants_1.Parameter.PAGINATION]) { | ||
output[constants_1.Parameter.PAGINATION] = (0, parameter_1.parseQueryParameter)(key, value, options[constants_1.Parameter.PAGINATION], relations); | ||
if (value && (0, parameter_1.isQueryParameterEnabled)(options[constants_1.Parameter.PAGINATION])) { | ||
output[constants_1.Parameter.PAGINATION] = (0, parameter_1.parseQueryParameter)(key, value, (0, parameter_1.buildQueryParameterOptions)(options[constants_1.Parameter.PAGINATION]), relations); | ||
} | ||
@@ -74,4 +74,4 @@ break; | ||
const value = (_e = input[constants_1.Parameter.SORT]) !== null && _e !== void 0 ? _e : input[constants_1.URLParameter.SORT]; | ||
if (value || options[constants_1.Parameter.SORT]) { | ||
output[constants_1.Parameter.SORT] = (0, parameter_1.parseQueryParameter)(key, value, mergeWithGlobalOptions(options[constants_1.Parameter.SORT]), relations); | ||
if (value && (0, parameter_1.isQueryParameterEnabled)(options[constants_1.Parameter.SORT])) { | ||
output[constants_1.Parameter.SORT] = (0, parameter_1.parseQueryParameter)(key, value, mergeWithGlobalOptions((0, parameter_1.buildQueryParameterOptions)(options[constants_1.Parameter.SORT])), relations); | ||
} | ||
@@ -78,0 +78,0 @@ break; |
export * from './module'; | ||
export * from './type'; | ||
export * from './utils'; |
@@ -25,2 +25,3 @@ "use strict"; | ||
__exportStar(require("./type"), exports); | ||
__exportStar(require("./utils"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -8,3 +8,3 @@ import { Parameter, URLParameter } from '../constants'; | ||
export declare type ParseOptions<T extends ObjectLiteral = ObjectLiteral> = { | ||
[P in `${Parameter}`]?: ParseParameterOptions<P, T>; | ||
[P in `${Parameter}`]?: boolean | ParseParameterOptions<P, T>; | ||
} & { | ||
@@ -11,0 +11,0 @@ defaultPath?: string; |
{ | ||
"name": "rapiq", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A tiny library which provides utility types/functions for request and response query handling.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
176825
1.22%192
1.59%2620
1.04%