Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

settings.js 1.2KB

1234567891011121314151617181920212223242526
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const path = require("path");
  4. const fsScandir = require("@nodelib/fs.scandir");
  5. class Settings {
  6. constructor(_options = {}) {
  7. this._options = _options;
  8. this.basePath = this._getValue(this._options.basePath, undefined);
  9. this.concurrency = this._getValue(this._options.concurrency, Infinity);
  10. this.deepFilter = this._getValue(this._options.deepFilter, null);
  11. this.entryFilter = this._getValue(this._options.entryFilter, null);
  12. this.errorFilter = this._getValue(this._options.errorFilter, null);
  13. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  14. this.fsScandirSettings = new fsScandir.Settings({
  15. followSymbolicLinks: this._options.followSymbolicLinks,
  16. fs: this._options.fs,
  17. pathSegmentSeparator: this._options.pathSegmentSeparator,
  18. stats: this._options.stats,
  19. throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
  20. });
  21. }
  22. _getValue(option, value) {
  23. return option === undefined ? value : option;
  24. }
  25. }
  26. exports.default = Settings;