Comparing version 4.0.0 to 4.0.1
@@ -43,6 +43,10 @@ 'use strict'; | ||
module.exports = function (src, dest, opts) { | ||
if (!(Array.isArray(src) && src.length > 0) || !dest) { | ||
return Promise.reject(new CpyError('`src` and `dest` required')); | ||
if (!Array.isArray(src)) { | ||
return Promise.reject(new CpyError('Expected `files` to be an array, got ' + typeof src)); | ||
} | ||
if (src.length === 0 || !dest) { | ||
return Promise.reject(new CpyError('`files` and `destination` required')); | ||
} | ||
opts = opts || {}; | ||
@@ -49,0 +53,0 @@ |
{ | ||
"name": "cpy", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Copy files", | ||
@@ -56,3 +56,2 @@ "license": "MIT", | ||
"ava": "*", | ||
"execa": "^0.1.1", | ||
"tempfile": "^1.1.1", | ||
@@ -59,0 +58,0 @@ "xo": "*" |
@@ -26,3 +26,3 @@ # cpy [![Build Status](https://travis-ci.org/sindresorhus/cpy.svg?branch=master)](https://travis-ci.org/sindresorhus/cpy) | ||
cpy(['src/*.png', '!src/goat.png'], 'dist']).then(() => { | ||
cpy(['src/*.png', '!src/goat.png'], 'dist').then(() => { | ||
console.log('files copied'); | ||
@@ -79,3 +79,3 @@ }); | ||
- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - CLI for this module | ||
- [cp-file](https://github.com/sindresorhus/cp-file) Copy a single file | ||
- [cp-file](https://github.com/sindresorhus/cp-file) - Copy a single file | ||
@@ -82,0 +82,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5267
3
53