@skaldapp/fsa 1.0.57 → 1.1.0
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/dist/index.d.ts +1 -1
- package/dist/index.js +9 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { StreamingBlobPayloadInputTypes } from "@smithy/types";
|
|
2
|
-
export declare const deleteObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<void>,
|
|
2
|
+
export declare const deleteObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<void>, getObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<Response>, headObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<undefined>, putObject: (Bucket: FileSystemDirectoryHandle, Key: string, body: StreamingBlobPayloadInputTypes) => Promise<void>, removeEmptyDirectories: (directory: FileSystemDirectoryHandle, exclude: string[]) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -26,13 +26,17 @@ export const deleteObject = async (Bucket, Key) => {
|
|
|
26
26
|
if (handle?.kind === "directory")
|
|
27
27
|
await handle.removeEntry(name);
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, getObject = async (Bucket, Key) => {
|
|
30
30
|
const handle = await getHandle(Bucket, Key);
|
|
31
|
-
if (handle?.kind === "file")
|
|
32
|
-
|
|
31
|
+
if (handle?.kind === "file") {
|
|
32
|
+
const file = await handle.getFile(), headers = new Headers({
|
|
33
|
+
"content-type": file.type,
|
|
34
|
+
});
|
|
35
|
+
return new Response(file, { headers });
|
|
36
|
+
}
|
|
33
37
|
else
|
|
34
|
-
return new
|
|
35
|
-
},
|
|
38
|
+
return new Response();
|
|
39
|
+
}, headObject = async (Bucket, Key) => {
|
|
36
40
|
const handle = await getHandle(Bucket, Key);
|
|
37
41
|
if (handle?.kind === "file")
|
|
38
42
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package",
|
|
3
3
|
"name": "@skaldapp/fsa",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"description": "A TypeScript library providing a File System Access API wrapper for web applications. Offers AWS S3-like operations (get, put, delete, head) to interact with local file systems efficiently in modern browsers.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"file-system-access",
|