MCPcopy Create free account
hub / github.com/decaporg/decap-cms / escapeRegExp

Function escapeRegExp

cypress/utils/regexp.js:1–3  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1const escapeRegExp = string => {
2 return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
3};
4
5module.exports = { escapeRegExp };

Callers 7

matchRouteFunction · 0.90
entrySlugFunction · 0.85
sanitizeSlugFunction · 0.85
getFilePathFunction · 0.85
sanitizeStringFunction · 0.85
sanitizeStringFunction · 0.85
sanitizeStringFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected