@zenfs/core 0.7.3 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -99,18 +99,14 @@ declare const AsyncStoreFS_base: (abstract new (...args: any[]) => {
99
99
  * @internal
100
100
  */
101
101
  export declare class AsyncStoreFS extends AsyncStoreFS_base {
102
+ protected _options: AsyncStoreOptions;
102
103
  protected store: AsyncStore;
103
104
  private _cache?;
104
105
  _sync: FileSystem;
105
106
  protected _ready: Promise<void>;
106
107
  ready(): Promise<this>;
107
108
  metadata(): FileSystemMetadata;
108
- constructor(options: AsyncStoreOptions);
109
- /**
110
- * Initializes the file system. Typically called by subclasses' async
111
- * constructors.
112
- */
113
- protected _initialize({ store, lruCacheSize, sync }: AsyncStoreOptions): Promise<void>;
109
+ constructor(_options: AsyncStoreOptions);
114
110
  /**
115
111
  * Delete all contents stored in the file system.
116
112
  */
@@ -53,7 +53,12 @@ class LRUCache {
53
53
  export class AsyncStoreFS extends Async(FileSystem) {
54
54
  async ready() {
55
55
  await super.ready();
56
- await this._ready;
56
+ if (this._options.lruCacheSize > 0) {
57
+ this._cache = new LRUCache(this._options.lruCacheSize);
58
+ }
59
+ this.store = await this._options.store;
60
+ await this.makeRootDirectory();
61
+ this._sync = this._options.sync || InMemory.create({ name: 'test' });
57
62
  return this;
58
63
  }
59
64
  metadata() {
@@ -62,21 +67,9 @@ export class AsyncStoreFS extends Async(FileSystem) {
62
67
  name: this.store.name,
63
68
  };
64
69
  }
65
- constructor(options) {
70
+ constructor(_options) {
66
71
  super();
67
- this._ready = this._initialize(options);
68
- }
69
- /**
70
- * Initializes the file system. Typically called by subclasses' async
71
- * constructors.
72
- */
73
- async _initialize({ store, lruCacheSize, sync }) {
74
- if (lruCacheSize > 0) {
75
- this._cache = new LRUCache(lruCacheSize);
76
- }
77
- this.store = await store;
78
- await this.makeRootDirectory();
79
- this._sync = sync || InMemory.create({ name: 'test' });
72
+ this._options = _options;
80
73
  }
81
74
  /**
82
75
  * Delete all contents stored in the file system.