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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const path = require("path");
  4. const deep_1 = require("./filters/deep");
  5. const entry_1 = require("./filters/entry");
  6. const error_1 = require("./filters/error");
  7. const entry_2 = require("./transformers/entry");
  8. class Provider {
  9. constructor(_settings) {
  10. this._settings = _settings;
  11. this.errorFilter = new error_1.default(this._settings);
  12. this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
  13. this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
  14. this.entryTransformer = new entry_2.default(this._settings);
  15. }
  16. _getRootDirectory(task) {
  17. return path.resolve(this._settings.cwd, task.base);
  18. }
  19. _getReaderOptions(task) {
  20. const basePath = task.base === '.' ? '' : task.base;
  21. return {
  22. basePath,
  23. pathSegmentSeparator: '/',
  24. concurrency: this._settings.concurrency,
  25. deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
  26. entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
  27. errorFilter: this.errorFilter.getFilter(),
  28. followSymbolicLinks: this._settings.followSymbolicLinks,
  29. fs: this._settings.fs,
  30. stats: this._settings.stats,
  31. throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
  32. transform: this.entryTransformer.getTransformer()
  33. };
  34. }
  35. _getMicromatchOptions() {
  36. return {
  37. dot: this._settings.dot,
  38. matchBase: this._settings.baseNameMatch,
  39. nobrace: !this._settings.braceExpansion,
  40. nocase: !this._settings.caseSensitiveMatch,
  41. noext: !this._settings.extglob,
  42. noglobstar: !this._settings.globstar,
  43. posix: true,
  44. strictSlashes: false
  45. };
  46. }
  47. }
  48. exports.default = Provider;