@skaldapp/fsa 1.0.57 → 1.1.1
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 +2 -2
- package/dist/index.js +12 -6
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { StreamingBlobPayloadInputTypes } from "@smithy/types";
|
|
2
|
-
export declare const deleteObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<void>,
|
|
1
|
+
import type { StreamingBlobPayloadInputTypes, StreamingBlobPayloadOutputTypes } from "@smithy/types";
|
|
2
|
+
export declare const deleteObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<void>, getObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<StreamingBlobPayloadOutputTypes>, 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,19 @@ export const deleteObject = async (Bucket, Key) => {
|
|
|
26
26
|
if (handle?.kind === "directory")
|
|
27
27
|
await handle.removeEntry(name);
|
|
28
28
|
}
|
|
29
|
-
},
|
|
30
|
-
const handle = await getHandle(Bucket, Key);
|
|
31
|
-
if (handle?.kind === "file")
|
|
32
|
-
|
|
29
|
+
}, getObject = async (Bucket, Key) => {
|
|
30
|
+
const $metadata = {}, handle = await getHandle(Bucket, Key);
|
|
31
|
+
if (handle?.kind === "file") {
|
|
32
|
+
const Body = await handle.getFile(), { type: ContentType } = Body;
|
|
33
|
+
return {
|
|
34
|
+
$metadata,
|
|
35
|
+
Body,
|
|
36
|
+
ContentType,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
33
39
|
else
|
|
34
|
-
return
|
|
35
|
-
},
|
|
40
|
+
return { $metadata };
|
|
41
|
+
}, headObject = async (Bucket, Key) => {
|
|
36
42
|
const handle = await getHandle(Bucket, Key);
|
|
37
43
|
if (handle?.kind === "file")
|
|
38
44
|
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.
|
|
4
|
+
"version": "1.1.1",
|
|
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",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"prettier": "@skaldapp/configs/prettierrc",
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@skaldapp/configs": "^1.2.
|
|
49
|
-
"@smithy/types": "^4.
|
|
48
|
+
"@skaldapp/configs": "^1.2.87",
|
|
49
|
+
"@smithy/types": "^4.14.0",
|
|
50
50
|
"@types/node": "^25.5.2",
|
|
51
51
|
"eslint": "^10.2.0"
|
|
52
52
|
}
|