Skip to content

Commit 62c5b5a

Browse files
committed
Revert "Fixes #4"
This reverts commit 930465f.
1 parent 35a72a7 commit 62c5b5a

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

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;
65
var EventEmitter = require('node:events').EventEmitter;
76
var fs = require('fs');
87
var junk = require('junk');
98
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 = posixPath.normalize(path);
173+
var p = slash(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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
"dependencies": {
5555
"errno": "^1.0.0",
5656
"junk": "^3.1.0",
57-
"minimatch": "^10.1.1"
57+
"minimatch": "^10.1.1",
58+
"slash": "^3.0.0"
5859
},
5960
"devDependencies": {
6061
"@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;
76
var chai = require('chai');
87
var expect = chai.expect;
98
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 = posixPath.normalize(fs.readlinkSync(getDestinationPath('nested-symlinks/file')));
457+
actual = slash(fs.readlinkSync(getDestinationPath('nested-symlinks/file')));
458458
expected = '../file';
459459
expect(actual).to.equal(expected);
460-
actual = posixPath.normalize(fs.readlinkSync(getDestinationPath('nested-symlinks/directory')));
460+
actual = slash(fs.readlinkSync(getDestinationPath('nested-symlinks/directory')));
461461
expected = '../directory';
462462
expect(actual).to.equal(expected);
463-
actual = posixPath.normalize(fs.readlinkSync(getDestinationPath('nested-symlinks/nested/directory')));
463+
actual = slash(fs.readlinkSync(getDestinationPath('nested-symlinks/nested/directory')));
464464
expected = '../../directory';
465465
expect(actual).to.equal(expected);
466466
});

0 commit comments

Comments
 (0)