UNPKG

msw

Version:

Seamless REST/GraphQL API mocking library for browser and Node.js.

15 lines 354 B
const REDUNDANT_CHARACTERS_EXP = /[\?|#].*$/g; function getSearchParams(path) { return new URL(`/${path}`, "http://localhost").searchParams; } function cleanUrl(path) { if (path.endsWith("?")) { return path; } return path.replace(REDUNDANT_CHARACTERS_EXP, ""); } export { cleanUrl, getSearchParams }; //# sourceMappingURL=cleanUrl.mjs.map