fs.js 727 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var path = require("path");
  4. var FileSystem = /** @class */ (function () {
  5. function FileSystem(options) {
  6. this.options = options;
  7. }
  8. /**
  9. * Return full path to entry.
  10. */
  11. FileSystem.prototype.getFullEntryPath = function (filepath) {
  12. return path.resolve(this.options.cwd, filepath);
  13. };
  14. /**
  15. * Return an implementation of the Entry interface.
  16. */
  17. FileSystem.prototype.makeEntry = function (stat, pattern) {
  18. return Object.assign(stat, {
  19. path: pattern,
  20. depth: pattern.split('/').length
  21. });
  22. };
  23. return FileSystem;
  24. }());
  25. exports.default = FileSystem;