Skip to content

Commit 930465f

Browse files
committed
Fixes #4
1 parent 5b5f110 commit 930465f

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

lib/copy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
var Promise = global.Promise;
44
var path = require('node:path');
5+
var posixPath = path.posix;
56
var EventEmitter = require('node:events').EventEmitter;
67
var fs = require('fs');
78
var junk = require('junk');
89
var errno = require('errno');
9-
var slash = require('slash');
1010
var maximatch = require('./maximatch.js');
1111

1212
var CopyError = errno.custom.createError('CopyError');
@@ -170,7 +170,7 @@ function getFilteredPaths(paths, filter, options) {
170170
if(!filter) {
171171
return true;
172172
}
173-
var p = slash(path);
173+
var p = posixPath.normalize(path);
174174
// filter might be a string, array, function
175175
var m = maximatch(p, filter, options);
176176
if(m.length > 0) {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@
5454
"dependencies": {
5555
"errno": "^1.0.0",
5656
"junk": "^3.1.0",
57-
"minimatch": "^10.1.1",
58-
"slash": "^3.0.0"
57+
"minimatch": "^10.1.1"
5958
},
6059
"devDependencies": {
6160
"@types/node": "^14.18.63",

test/spec/copy.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
var Promise = global.Promise;
44
var fs = require('node:fs');
55
var path = require('node:path');
6+
var posixPath = path.posix;
67
var chai = require('chai');
78
var expect = chai.expect;
89
var chaiAsPromised = require('chai-as-promised');
9-
var slash = require('slash');
1010
var readDirFiles = require('read-dir-files');
1111
var through = require('through2');
1212
var rewire = require('rewire');
@@ -454,13 +454,13 @@ describe('copy()', function() {
454454
getDestinationPath('nested-symlinks')
455455
).then(function(results) {
456456
var actual, expected;
457-
actual = slash(fs.readlinkSync(getDestinationPath('nested-symlinks/file')));
457+
actual = posixPath.normalize(fs.readlinkSync(getDestinationPath('nested-symlinks/file')));
458458
expected = '../file';
459459
expect(actual).to.equal(expected);
460-
actual = slash(fs.readlinkSync(getDestinationPath('nested-symlinks/directory')));
460+
actual = posixPath.normalize(fs.readlinkSync(getDestinationPath('nested-symlinks/directory')));
461461
expected = '../directory';
462462
expect(actual).to.equal(expected);
463-
actual = slash(fs.readlinkSync(getDestinationPath('nested-symlinks/nested/directory')));
463+
actual = posixPath.normalize(fs.readlinkSync(getDestinationPath('nested-symlinks/nested/directory')));
464464
expected = '../../directory';
465465
expect(actual).to.equal(expected);
466466
});

0 commit comments

Comments
 (0)