Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ed96f4

Browse files
committed
fixes for windows paths
1 parent 84efafe commit 6ed96f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/fileExists.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { accessSync, F_OK} = require('fs');
3+
const { accessSync, F_OK } = require('fs');
44

55
function fileExists(path) {
66
try {

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var fileExists = require('./fileExists');
1111
*/
1212
function rewire(filename) {
1313
// is not a node_module path
14-
if (!filename.match(/^[a-zA-Z\_]/) || filename.match(/^[A-Z]:)) {
14+
if (!filename.match(/^[a-zA-Z\_]/) || filename.match(/^[A-Z]:[\\\/]/)) {
1515
if (!fileExists(filename)) {
1616
// create a __get__ mock to prevent tests breaking
1717
// when file does not exist

0 commit comments

Comments
 (0)