LazyFS.js 626 B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.LazyFS = void 0;
  4. const ProxiedFS_1 = require("./ProxiedFS");
  5. class LazyFS extends ProxiedFS_1.ProxiedFS {
  6. constructor(factory, pathUtils) {
  7. super(pathUtils);
  8. this.instance = null;
  9. this.factory = factory;
  10. }
  11. get baseFs() {
  12. if (!this.instance)
  13. this.instance = this.factory();
  14. return this.instance;
  15. }
  16. set baseFs(value) {
  17. this.instance = value;
  18. }
  19. mapFromBase(p) {
  20. return p;
  21. }
  22. mapToBase(p) {
  23. return p;
  24. }
  25. }
  26. exports.LazyFS = LazyFS;