MCPcopy Index your code
hub / github.com/react/react / asyncCopyTo

Function asyncCopyTo

scripts/rollup/utils.js:10–27  ·  view source on GitHub ↗
(from, to)

Source from the content-addressed store, hash-verified

8const targz = require('targz');
9
10function asyncCopyTo(from, to) {
11 return asyncMkDirP(path.dirname(to)).then(
12 () =>
13 new Promise((resolve, reject) => {
14 ncp(from, to, error => {
15 if (error) {
16 // Wrap to have a useful stack trace.
17 reject(new Error(error));
18 } else {
19 // Wait for copied files to exist; ncp() sometimes completes prematurely.
20 // For more detail, see github.com/facebook/react/issues/22323
21 // Also github.com/AvianFlu/ncp/issues/127
22 setTimeout(resolve, 10);
23 }
24 });
25 })
26 );
27}
28
29function asyncExecuteCommand(command) {
30 return new Promise((resolve, reject) =>

Callers 4

copyWWWShimsFunction · 0.70
copyRNShimsFunction · 0.70
prepareNpmPackageFunction · 0.70
doSyncFunction · 0.70

Calls 3

asyncMkDirPFunction · 0.85
thenMethod · 0.65
rejectFunction · 0.50

Tested by

no test coverage detected