Skip to content
This repository was archived by the owner on Oct 27, 2020. It is now read-only.
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ function loader(...args) {
// this.fs can be undefined
// e.g when using the thread-loader
// fallback to the fs module
const stat = this.fs ? this.fs.stat : fs.stat;
const tempFs = this.fs || fs;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const tempFs = this.fs || fs;
const FS = this.fs || fs;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-ciniawsky FS? Why in uppercase? Why not usingFs or something related?

const toDepDetails = (dep, mapCallback) => {
stat(dep, (err, stats) => {
tempFs.stat(dep, (err, stats) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tempFs.stat(dep, (err, stats) => {
FS.stat(dep, (err, stats) => {

if (err) {
mapCallback(err);
return;
Expand Down Expand Up @@ -112,9 +112,9 @@ function pitch(remainingRequest, prevRequest, dataInput) {
callback();
return;
}
const stat = this.fs ? this.fs.stat : fs.stat;
const tempFs = this.fs || fs;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const tempFs = this.fs || fs;
const FS = this.fs || fs;

async.each(cacheData.dependencies.concat(cacheData.contextDependencies), (dep, eachCallback) => {
stat(dep.path, (statErr, stats) => {
tempFs.stat(dep.path, (statErr, stats) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tempFs.stat(dep.path, (statErr, stats) => {
FS.stat(dep.path, (statErr, stats) => {

if (statErr) {
eachCallback(statErr);
return;
Expand Down