Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DavidWells/analytics
/ escapeRegexString
Function
escapeRegexString
packages/analytics-util-params/src/utils/regex.js:4–6 ·
view source on GitHub ↗
(str)
Source
from the content-addressed store, hash-verified
2
export
const
queryRegex = /([^=?&]+)(=)?([^&]*)/g
3
4
export
function
escapeRegexString(str) {
5
return
str.replace(/[|\\{}()[\]^$+*?.-]/g,
'\\$&'
)
6
}
7
8
export
function
isArrayParam(key) {
9
return
key.substring(key.length - 2) ===
'[]'
Callers
1
paramsClean
Function · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected