Skip to content

Commit dd46bce

Browse files
committed
fs: keep return type of options.filter in cpsync consistent with doc
1 parent 52f8dcf commit dd46bce

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/internal/fs/cp/cp-sync.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const {
4646
parse,
4747
resolve,
4848
} = require('path');
49-
const { isPromise } = require('util/types');
5049

5150
function cpSyncFn(src, dest, opts) {
5251
// Warn about using preserveTimestamps on 32-bit node
@@ -64,7 +63,7 @@ function cpSyncFn(src, dest, opts) {
6463
function checkPathsSync(src, dest, opts) {
6564
if (opts.filter) {
6665
const shouldCopy = opts.filter(src, dest);
67-
if (isPromise(shouldCopy)) {
66+
if (typeof shouldCopy !== 'boolean') {
6867
throw new ERR_INVALID_RETURN_VALUE('boolean', 'filter', shouldCopy);
6968
}
7069
if (!shouldCopy) return { __proto__: null, skipped: true };

0 commit comments

Comments
 (0)