Skip to content
This repository was archived by the owner on Oct 27, 2020. It is now read-only.

perf: throw early if file doesn't exists #5

Merged
merged 1 commit into from
Jun 8, 2017

Conversation

alexander-akait
Copy link
Member

Why:

  1. fs.exists is deprecated.
  2. fs.readFile also throw error if the file is not readable or not exist. It is reduce fs call.

@codecov
Copy link

codecov bot commented Jun 7, 2017

Codecov Report

Merging #5 into master will decrease coverage by 15.47%.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #5       +/-   ##
=======================================
- Coverage   15.47%   0%   -15.48%     
=======================================
  Files           2    2               
  Lines          84   80        -4     
  Branches       13   12        -1     
=======================================
- Hits           13    0       -13     
+ Misses         71   68        -3     
- Partials        0   12       +12
Impacted Files Coverage Δ
src/index.js 0% <0%> (-15.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89bab1f...50f994b. Read the comment docs.

@alexander-akait alexander-akait requested a review from sokra June 7, 2017 22:50
Copy link

@Jessidhia Jessidhia left a comment

Choose a reason for hiding this comment

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

Avoids a stat(2) call, SGTM.

Almost all of the diff is just a reindent.

@michael-ciniawsky michael-ciniawsky changed the title bug: improve perf perf: throw early if file doesn't exists Jun 8, 2017
@michael-ciniawsky michael-ciniawsky merged commit a7f3449 into webpack-contrib:master Jun 8, 2017
@alexander-akait alexander-akait deleted the perf branch June 8, 2017 10:44
@michael-ciniawsky michael-ciniawsky modified the milestone: 1.0.4 Sep 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants