@stackflow/plugin-history-sync
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -62,3 +62,3 @@ "use strict"; | ||
// src/historyState.ts | ||
var STATE_TAG = `${"@stackflow/plugin-history-sync"}@${"1.2.0"}`; | ||
var STATE_TAG = `${"@stackflow/plugin-history-sync"}@${"1.3.0"}`; | ||
function serializeStep(step) { | ||
@@ -156,3 +156,10 @@ return __spreadProps(__spreadValues({}, step), { | ||
}); | ||
const searchParams = new URLSearchParams(searchParamsMap); | ||
const searchParams = new URLSearchParams( | ||
Object.entries(searchParamsMap).reduce( | ||
(acc, [key, value]) => __spreadValues(__spreadValues({}, acc), value ? { | ||
[key]: value | ||
} : null), | ||
{} | ||
) | ||
); | ||
return appendTrailingSlashInPathname(pathname) + prependQuestionMarkInSearchParams(searchParams); | ||
@@ -159,0 +166,0 @@ }, |
{ | ||
"name": "@stackflow/plugin-history-sync", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"license": "MIT", | ||
@@ -82,3 +82,3 @@ "exports": { | ||
}, | ||
"gitHead": "12ede8f171da8d5994293e30cf5850c6cea6260c" | ||
"gitHead": "473a4949ce925d54424d7bf56579538db6a814b7" | ||
} |
@@ -55,1 +55,12 @@ import { makeTemplate } from "./makeTemplate"; | ||
}); | ||
test("makeTemplate - 패스 파라미터에 `undefined` 값이 포함된 경우 삭제합니다", () => { | ||
const template = makeTemplate("/articles"); | ||
expect( | ||
template.fill({ | ||
articleId: "1234", | ||
test: undefined, | ||
}), | ||
).toEqual("/articles/?articleId=1234"); | ||
}); |
@@ -63,3 +63,15 @@ import UrlPattern from "url-pattern"; | ||
const searchParams = new URLSearchParams(searchParamsMap as any); | ||
const searchParams = new URLSearchParams( | ||
Object.entries(searchParamsMap).reduce( | ||
(acc, [key, value]) => ({ | ||
...acc, | ||
...(value | ||
? { | ||
[key]: value, | ||
} | ||
: null), | ||
}), | ||
{} as Record<string, string>, | ||
), | ||
); | ||
@@ -66,0 +78,0 @@ return ( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138681
2380