MCPcopy Create free account
hub / github.com/effector/effector / massCopy

Function massCopy

tools/builder/utils.ts:117–139  ·  view source on GitHub ↗
(
  from: string,
  to: string,
  targets: Array<string | [string, string | string[]]>,
)

Source from the content-addressed store, hash-verified

115}
116
117export function massCopy(
118 from: string,
119 to: string,
120 targets: Array<string | [string, string | string[]]>,
121) {
122 const jobs: [string, string][] = []
123 for (const target of targets) {
124 if (typeof target === 'string') {
125 jobs.push([dir(from, target), dir(to, target)])
126 } else {
127 const [fromFile, toFile] = target
128 if (typeof toFile === 'string') {
129 jobs.push([dir(from, fromFile), dir(to, toFile)])
130 } else {
131 for (const toFileName of toFile) {
132 jobs.push([dir(from, fromFile), dir(to, toFileName)])
133 }
134 }
135 }
136 }
137
138 return Promise.all(jobs.map(([from, to]) => fs.copy(from, to)))
139}
140
141/* eslint-disable max-len */
142/**

Callers 2

copyLicenseFunction · 0.90
effector.tsFile · 0.90

Calls 2

dirFunction · 0.85
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…