Skip to content

Commit 781f009

Browse files
committed
fix(core): use multi property rather than checking value type
1 parent 5ee910b commit 781f009

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

projects/ngqp/core/src/lib/query-param-group.directive.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ function hasArrayValue<T>(queryParam: QueryParam<T | T[]>, value: T | T[]): valu
1717
return isMultiQueryParam(queryParam);
1818
}
1919

20+
/** TODO Documentation */
21+
function hasArraySerialization<T>(queryParam: QueryParam<T | T[]>, values: string | string[]): values is string[] {
22+
return isMultiQueryParam(queryParam);
23+
}
24+
2025
/**
2126
* TODO Documentation
2227
*/
@@ -160,7 +165,7 @@ export class QueryParamGroupDirective implements OnInit, OnDestroy {
160165
}
161166

162167
private deserialize<T = any>(queryParam: QueryParam<T>, values: string | string[]): Unpack<T> | Unpack<T>[] {
163-
if (Array.isArray(values)) {
168+
if (hasArraySerialization(queryParam, values)) {
164169
return values.map(queryParam.deserialize);
165170
} else {
166171
return queryParam.deserialize(values);

0 commit comments

Comments
 (0)