Comparing version 0.0.2 to 0.1.0
25
index.js
@@ -20,17 +20,20 @@ var gulp = require('gulp') | ||
if(srcs.length !== dsts.length) { | ||
throw new Error('路径数组不相等') | ||
return Promise.reject('路径数组不相等') | ||
} | ||
var i = 0; | ||
var MAX = srcs.length; | ||
function end() { | ||
i++; | ||
if(i === MAX && typeof cb === 'function') { | ||
cb() | ||
return new Promise((resolve, reject) => { | ||
var i = 0 | ||
var MAX = srcs.length | ||
function end() { | ||
i++; | ||
if(i === MAX && typeof cb === 'function') { | ||
cb() | ||
} | ||
resolve() | ||
} | ||
} | ||
srcs.forEach((src, i) => { | ||
copy(src, dsts[i], end) | ||
}, this) | ||
srcs.forEach((src, i) => { | ||
copy(src, dsts[i], end) | ||
}, this) | ||
}) | ||
} | ||
module.exports = copys2 |
{ | ||
"name": "copys2", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "copys2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,5 +17,6 @@ # copys2 | ||
] | ||
copys2(srcs, dsts, () => { | ||
console.log('ok') | ||
}) | ||
copys2(srcs, dsts) | ||
.then(() => { | ||
console.log('ok') | ||
}) | ||
``` |
@@ -11,4 +11,5 @@ var path = require('path') | ||
] | ||
copys2(srcs, dsts, () => { | ||
console.log('ok') | ||
}) | ||
copys2(srcs, dsts) | ||
.then(() => { | ||
console.log('ok') | ||
}) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1947
47
21
1