@vuebro/fsa 1.0.3 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +21 -19
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,22 +1,24 @@
1
- const getHandle = (Bucket, Key, create = false) => Key.split("/").reduce(async (previousValue, currentValue, currentIndex, array) => {
2
- const handle = await previousValue;
3
- if (handle?.kind === "directory" && currentValue)
4
- try {
5
- return await handle.getDirectoryHandle(currentValue, { create });
6
- }
7
- catch {
8
- if (currentIndex === array.length - 1)
9
- try {
10
- return await handle.getFileHandle(currentValue, {
11
- create: false,
12
- });
13
- }
14
- catch {
15
- return;
16
- }
17
- }
18
- return;
19
- }, Promise.resolve(Bucket));
1
+ const getHandle = (Bucket, Key, create = false) => Key
2
+ ? Key.split("/").reduce(async (previousValue, currentValue, currentIndex, array) => {
3
+ const handle = await previousValue;
4
+ if (handle?.kind === "directory" && currentValue)
5
+ try {
6
+ return await handle.getDirectoryHandle(currentValue, { create });
7
+ }
8
+ catch {
9
+ if (currentIndex === array.length - 1)
10
+ try {
11
+ return await handle.getFileHandle(currentValue, {
12
+ create: false,
13
+ });
14
+ }
15
+ catch {
16
+ return;
17
+ }
18
+ }
19
+ return;
20
+ }, Promise.resolve(Bucket))
21
+ : Promise.resolve(Bucket);
20
22
  export const deleteObject = async (Bucket, Key) => {
21
23
  const keys = Key.split("/"), name = keys.pop();
22
24
  if (name) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vuebro/fsa",
3
- "version": "1.0.3",
4
- "description": "A TypeScript library providing a File System Access API wrapper that enables web applications to interact with the user's local file system using AWS S3-like operations (get, put, delete, head). Designed for modern browsers, this library offers structured file and directory access capabilities similar to cloud storage APIs, allowing web applications to work with local files and directories more efficiently than traditional file input methods.",
3
+ "version": "1.0.5",
4
+ "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.",
5
5
  "keywords": [
6
6
  "file-system-access",
7
7
  "web-api",
@@ -42,7 +42,7 @@
42
42
  "devDependencies": {
43
43
  "@smithy/types": "^4.8.1",
44
44
  "@types/node": "24.10.0",
45
- "@vuebro/configs": "^1.1.75",
45
+ "@vuebro/configs": "^1.1.76",
46
46
  "eslint": "^9.39.1"
47
47
  }
48
48
  }