"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.directoryIterator = directoryIterator;

var _fs = require("fs");

var _path = require("path");

function directoryIterator(filename, callback) {
  if (!(0, _fs.statSync)(filename).isDirectory()) {
    callback(filename);
    return;
  }

  (0, _fs.readdirSync)(filename).forEach(fileOrDir => {
    directoryIterator((0, _path.join)(filename, fileOrDir), callback);
  });
}