@b9g/filesystem 0.1.8 → 0.1.10

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.
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@b9g/filesystem",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Universal File System Access API implementations for all platforms",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/bikeshaving/shovel.git",
9
+ "directory": "packages/filesystem"
10
+ },
6
11
  "dependencies": {
7
12
  "mime": "^4.0.4"
8
13
  },
package/src/bun-s3.d.ts CHANGED
@@ -73,3 +73,4 @@ export declare class S3Directory implements FileSystemDirectoryHandle {
73
73
  queryPermission(): Promise<PermissionState>;
74
74
  requestPermission(): Promise<PermissionState>;
75
75
  }
76
+ export default S3Directory;
package/src/bun-s3.js CHANGED
@@ -154,7 +154,8 @@ var S3FileSystemBackend = class {
154
154
  }
155
155
  }
156
156
  } catch (error) {
157
- if (error instanceof DOMException) throw error;
157
+ if (error instanceof DOMException)
158
+ throw error;
158
159
  throw new DOMException("Entry not found", "NotFoundError");
159
160
  }
160
161
  }
@@ -256,7 +257,8 @@ var S3Directory = class _S3Directory {
256
257
  return this.entries();
257
258
  }
258
259
  async isSameEntry(other) {
259
- if (other.kind !== "directory") return false;
260
+ if (other.kind !== "directory")
261
+ return false;
260
262
  return other instanceof _S3Directory && other.name === this.name;
261
263
  }
262
264
  async queryPermission() {
@@ -266,7 +268,9 @@ var S3Directory = class _S3Directory {
266
268
  return "granted";
267
269
  }
268
270
  };
271
+ var bun_s3_default = S3Directory;
269
272
  export {
270
273
  S3Directory,
271
- S3FileSystemBackend
274
+ S3FileSystemBackend,
275
+ bun_s3_default as default
272
276
  };
package/src/index.js CHANGED
@@ -96,8 +96,10 @@ var ShovelHandle = class _ShovelHandle {
96
96
  return this.#backend;
97
97
  }
98
98
  async isSameEntry(other) {
99
- if (other.kind !== this.kind) return false;
100
- if (!(other instanceof _ShovelHandle)) return false;
99
+ if (other.kind !== this.kind)
100
+ return false;
101
+ if (!(other instanceof _ShovelHandle))
102
+ return false;
101
103
  return this.path === other.path;
102
104
  }
103
105
  async queryPermission(_descriptor) {
package/src/memory.d.ts CHANGED
@@ -76,4 +76,4 @@ export declare class MemoryDirectory implements FileSystemDirectoryHandle {
76
76
  queryPermission(): Promise<PermissionState>;
77
77
  requestPermission(): Promise<PermissionState>;
78
78
  }
79
- export {};
79
+ export default MemoryDirectory;
package/src/memory.js CHANGED
@@ -11,7 +11,8 @@ var MemoryFileSystemBackend = class {
11
11
  }
12
12
  async stat(path) {
13
13
  const entry = this.#resolvePath(path);
14
- if (!entry) return null;
14
+ if (!entry)
15
+ return null;
15
16
  if ("content" in entry) {
16
17
  return { kind: "file" };
17
18
  } else {
@@ -114,14 +115,17 @@ var MemoryFileSystemBackend = class {
114
115
  let current = this.#root;
115
116
  for (let i = 0; i < parts.length - 1; i++) {
116
117
  const nextDir = current.directories.get(parts[i]);
117
- if (!nextDir) return null;
118
+ if (!nextDir)
119
+ return null;
118
120
  current = nextDir;
119
121
  }
120
122
  const finalName = parts[parts.length - 1];
121
123
  const file = current.files.get(finalName);
122
- if (file) return file;
124
+ if (file)
125
+ return file;
123
126
  const dir = current.directories.get(finalName);
124
- if (dir) return dir;
127
+ if (dir)
128
+ return dir;
125
129
  return null;
126
130
  }
127
131
  #resolveParent(path) {
@@ -248,7 +252,8 @@ var MemoryDirectory = class _MemoryDirectory {
248
252
  return this.entries();
249
253
  }
250
254
  async isSameEntry(other) {
251
- if (other.kind !== "directory") return false;
255
+ if (other.kind !== "directory")
256
+ return false;
252
257
  return other instanceof _MemoryDirectory && other.name === this.name;
253
258
  }
254
259
  async queryPermission() {
@@ -258,7 +263,9 @@ var MemoryDirectory = class _MemoryDirectory {
258
263
  return "granted";
259
264
  }
260
265
  };
266
+ var memory_default = MemoryDirectory;
261
267
  export {
262
268
  MemoryDirectory,
263
- MemoryFileSystemBackend
269
+ MemoryFileSystemBackend,
270
+ memory_default as default
264
271
  };
package/src/node-fs.d.ts CHANGED
@@ -43,3 +43,4 @@ export declare class NodeFSDirectory extends ShovelDirectoryHandle {
43
43
  });
44
44
  get name(): string;
45
45
  }
46
+ export default NodeFSDirectory;
package/src/node-fs.js CHANGED
@@ -156,7 +156,9 @@ var NodeFSDirectory = class extends ShovelDirectoryHandle {
156
156
  return Path.basename(this.#rootPath) || "root";
157
157
  }
158
158
  };
159
+ var node_fs_default = NodeFSDirectory;
159
160
  export {
160
161
  NodeFSBackend,
161
- NodeFSDirectory
162
+ NodeFSDirectory,
163
+ node_fs_default as default
162
164
  };