Skip to content

Commit 0e8c81b

Browse files
committed
cleaned up a bit
1 parent b6c376c commit 0e8c81b

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

lib/correctPath.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
'use strict';
22

3+
Object.defineProperty(exports, "__esModule", {
4+
value: true
5+
});
6+
exports.unixify = unixify;
7+
exports.correctPath = correctPath;
38
var isWin = process.platform === 'win32';
49

510
function removeTrailingSeparator(str) {
@@ -41,6 +46,4 @@ function unixify(filepath) {
4146

4247
function correctPath(filepath) {
4348
return unixify(filepath.replace(/^\\\\\?\\.:\\/, '\\'));
44-
}
45-
46-
module.exports = correctPath;
49+
}

lib/patchRequire.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var path = _interopRequireWildcard(_path);
1111

1212
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
1313

14-
var correctPath = process.platform === 'win32' ? require('./correctPath') : function (p) {
14+
var correctPath = process.platform === 'win32' ? require('./correctPath').correctPath : function (p) {
1515
return p;
1616
};
1717

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fs-monkey",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Monkey patches for file system related things.",
55
"main": "lib/index.js",
66
"keywords": [

src/correctPath.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function normalizePath(str, stripTrailing) {
4747
* Copyright (c) 2014, 2017, Jon Schlinkert.
4848
* Released under the MIT License.
4949
*/
50-
function unixify(filepath, stripTrailing = true) {
50+
export function unixify(filepath, stripTrailing = true) {
5151
if(isWin) {
5252
filepath = normalizePath(filepath, stripTrailing);
5353
return filepath.replace(/^([a-zA-Z]+:|\.\/)/, '');
@@ -58,8 +58,6 @@ function unixify(filepath, stripTrailing = true) {
5858
/*
5959
* Corrects a windows path to unix format (including \\?\c:...)
6060
*/
61-
function correctPath(filepath) {
61+
export function correctPath(filepath) {
6262
return unixify( filepath.replace(/^\\\\\?\\.:\\/,'\\'));
6363
}
64-
65-
module.exports = correctPath;

src/patchRequire.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as path from 'path';
22

3-
const correctPath = process.platform === 'win32' ? require('./correctPath') : (p)=>p;
3+
const correctPath = process.platform === 'win32' ? require('./correctPath').correctPath : (p)=>p;
44

55
/**
66
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)

0 commit comments

Comments
 (0)