MCPcopy
hub / github.com/jestjs/jest / copyDir

Function copyDir

e2e/Utils.ts:182–194  ·  view source on GitHub ↗
(src: string, dest: string)

Source from the content-addressed store, hash-verified

180};
181
182export const copyDir = (src: string, dest: string) => {
183 const srcStat = fs.lstatSync(src);
184 if (srcStat.isDirectory()) {
185 if (!fs.existsSync(dest)) {
186 fs.mkdirSync(dest);
187 }
188 fs.readdirSync(src).map(filePath =>
189 copyDir(path.join(src, filePath), path.join(dest, filePath)),
190 );
191 } else {
192 fs.writeFileSync(dest, fs.readFileSync(src));
193 }
194};
195
196export const replaceSeed = (str: string) =>
197 str.replaceAll(/Seed: {8}(-?\d+)/g, 'Seed: <<REPLACED>>');

Callers 1

transform.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected