summaryrefslogtreecommitdiffstats
path: root/node_modules/babel-loader/lib/utils/exists.js
blob: 7307a31b507832aafcd8183573aaad38c4a6b86b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
"use strict";

module.exports = function (fileSystem, filename) {
  var exists = false;

  try {
    exists = fileSystem.statSync(filename).isFile();
  } catch (err) {
    if (err.code !== "ENOENT") throw err;
  }

  return exists;
};