MCPcopy 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

2export const queryRegex = /([^=?&]+)(=)?([^&]*)/g
3
4export function escapeRegexString(str) {
5 return str.replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&')
6}
7
8export function isArrayParam(key) {
9 return key.substring(key.length - 2) === '[]'

Callers 1

paramsCleanFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected