MCPcopy Index your code
hub / github.com/adaptlearning/adapt_framework / escapeRegExp

Function escapeRegExp

grunt/tasks/javascript.js:7–9  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

5 const convertSlashes = /\\/g;
6
7 function escapeRegExp(string) {
8 return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
9 }
10
11 const path = require('path');
12 const fs = require('fs-extra');

Callers 1

saveCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected