const SLASH_RE = /\//g // %2F
const EQUAL_RE = /=/g // %3D
const IM_RE = /\?/g // %3F
-const PLUS_RE = /\+/g // %2B
+export const PLUS_RE = /\+/g // %2B
/**
* NOTE: It's not clear to me if we should encode the + symbol in queries, it
* seems to be less flexible than not doing so and I can't find out the legacy
-import { decode, encodeQueryKey, encodeQueryValue } from './encoding'
+import { decode, encodeQueryKey, encodeQueryValue, PLUS_RE } from './encoding'
/**
* Possible values in normalized {@link LocationQuery}
const searchParams = (hasLeadingIM ? search.slice(1) : search).split('&')
for (let i = 0; i < searchParams.length; ++i) {
// pre decode the + into space
- // FIXME: can't import PLUS_RE because it becomes a different regex ???
- const searchParam = searchParams[i].replace(/\+/g, ' ')
+ const searchParam = searchParams[i].replace(PLUS_RE, ' ')
// allow the = character
let eqPos = searchParam.indexOf('=')
let key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos))