Skip to content

Commit

Permalink
Fixes #15, Bump to 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenpelgrims committed Jun 3, 2024
1 parent d81bae5 commit e22e38b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-use-query-param",
"version": "1.0.1",
"version": "1.0.2",
"description": "Use url query parameter like regular refs in Vue, in a typesafe way.",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
4 changes: 4 additions & 0 deletions src/converters/array.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ describe("arrayParam", () => {
const { deserialize } = arrayParam(stringParam());
expect(deserialize("abc")).toEqual(["abc"]);
});
test("non-array empty string", () => {
const { deserialize } = arrayParam(stringParam());
expect(deserialize("")).toEqual([""]);
});
});
});
2 changes: 1 addition & 1 deletion src/converters/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function arrayParam<TParam>(
return values.map(elementConfig.serialize) as LocationQueryValue[];
},
deserialize: (values) => {
if (!values) {
if (values === null || values === undefined) {
return undefined;
}

Expand Down

0 comments on commit e22e38b

Please sign in to comment.