Skip to content

Commit 91a75ba

Browse files
committed
fix(core): Do not consider undefined for emptyOn
1 parent ba22662 commit 91a75ba

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

projects/ngqp/core/src/lib/model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ export class QueryParamControl<T> {
174174
private changeFunctions: OnChangeFunction<T>[] = [];
175175

176176
constructor(opts: QueryParamControlOpts<T>) {
177-
const { name, serialize, deserialize, debounceTime, emptyOn, compareWith, combineWith } = opts;
177+
const { name, serialize, deserialize, debounceTime, compareWith, combineWith } = opts;
178+
const { emptyOn = null } = opts;
178179
const multi = opts.multi === true;
179180

180181
if (isMissing(name)) {

projects/ngqp/core/src/lib/serializers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function createEmptyOnSerializer<T>(serializer: ParamSerializer<T>, empty
1212
* TODO Documentation
1313
*/
1414
export function createEmptyOnDeserializer<T>(deserializer: ParamDeserializer<T>, emptyOn: T): ParamDeserializer<T> {
15-
return (value: string | null) => isMissing(value) ? emptyOn : deserializer(value);
15+
return (value: string | null) => value === null ? emptyOn : deserializer(value);
1616
}
1717

1818
/**

0 commit comments

Comments
 (0)