We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2806208 commit bdfd3a3Copy full SHA for bdfd3a3
src/patchRequire.js
@@ -1,6 +1,7 @@
1
import * as path from 'path';
2
3
-const correctPath = process.platform === 'win32' ? require('./correctPath').correctPath : p => p;
+const isWin32 = process.platform === 'win32';
4
+const correctPath = isWin32 ? require('./correctPath').correctPath : p => p;
5
6
/**
7
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
@@ -35,7 +36,7 @@ function stripBOM(content) {
35
36
export default function patchRequire(vol, unixifyPaths = false, Module = require('module')) {
37
38
// ensure all paths are corrected before use.
- if(process.platform === 'win32' && unixifyPaths) {
39
+ if(isWin32 && unixifyPaths) {
40
const original = vol;
41
vol = {
42
readFileSync: (path,options) => {
0 commit comments