Skip to content

Commit bdfd3a3

Browse files
committed
chore: win32 once
1 parent 2806208 commit bdfd3a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/patchRequire.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as path from 'path';
22

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

56
/**
67
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
@@ -35,7 +36,7 @@ function stripBOM(content) {
3536
export default function patchRequire(vol, unixifyPaths = false, Module = require('module')) {
3637

3738
// ensure all paths are corrected before use.
38-
if(process.platform === 'win32' && unixifyPaths) {
39+
if(isWin32 && unixifyPaths) {
3940
const original = vol;
4041
vol = {
4142
readFileSync: (path,options) => {

0 commit comments

Comments
 (0)