@depup/jsonjoy.com__fs-node-to-fsa 4.56.11-depup.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Vadims @streamich Daleckis <vadimsdaleckis@gmail.com>
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @depup/jsonjoy.com__fs-node-to-fsa
2
+
3
+ > Dependency-bumped version of [@jsonjoy.com/fs-node-to-fsa](https://www.npmjs.com/package/@jsonjoy.com/fs-node-to-fsa)
4
+
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @depup/jsonjoy.com__fs-node-to-fsa
12
+ ```
13
+
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [@jsonjoy.com/fs-node-to-fsa](https://www.npmjs.com/package/@jsonjoy.com/fs-node-to-fsa) @ 4.56.11 |
17
+ | Processed | 2026-03-17 |
18
+ | Smoke test | passed |
19
+ | Deps updated | 0 |
20
+
21
+ ---
22
+
23
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/@jsonjoy.com/fs-node-to-fsa
24
+
25
+ License inherited from the original package.
package/changes.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "bumped": {},
3
+ "timestamp": "2026-03-17T16:32:00.926Z",
4
+ "totalUpdated": 0
5
+ }
@@ -0,0 +1,72 @@
1
+ import { NodeFileSystemHandle } from './NodeFileSystemHandle';
2
+ import type { NodeFsaContext, NodeFsaFs } from './types';
3
+ import type { GetDirectoryHandleOptions, GetFileHandleOptions, IFileSystemDirectoryHandle, IFileSystemFileHandle, IFileSystemHandle, RemoveEntryOptions } from '@jsonjoy.com/fs-fsa';
4
+ /**
5
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle
6
+ */
7
+ export declare class NodeFileSystemDirectoryHandle extends NodeFileSystemHandle implements IFileSystemDirectoryHandle {
8
+ protected readonly fs: NodeFsaFs;
9
+ protected readonly ctx: NodeFsaContext;
10
+ /** Directory path with trailing slash. */
11
+ readonly __path: string;
12
+ constructor(fs: NodeFsaFs, path: string, ctx?: Partial<NodeFsaContext>);
13
+ /**
14
+ * Returns a new array iterator containing the keys for each item in
15
+ * {@link NodeFileSystemDirectoryHandle} object.
16
+ *
17
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/keys
18
+ */
19
+ keys(): AsyncIterableIterator<string>;
20
+ /**
21
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/entries
22
+ */
23
+ entries(): AsyncIterableIterator<[string, NodeFileSystemHandle]>;
24
+ /**
25
+ * Returns a new array iterator containing the values for each index in the
26
+ * {@link FileSystemDirectoryHandle} object.
27
+ *
28
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/values
29
+ */
30
+ values(): AsyncIterableIterator<NodeFileSystemHandle>;
31
+ /**
32
+ * Returns a {@link NodeFileSystemDirectoryHandle} for a subdirectory with the specified
33
+ * name within the directory handle on which the method is called.
34
+ *
35
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle
36
+ * @param name A string representing the {@link NodeFileSystemHandle} name of
37
+ * the subdirectory you wish to retrieve.
38
+ * @param options An optional object containing options for the retrieved
39
+ * subdirectory.
40
+ */
41
+ getDirectoryHandle(name: string, options?: GetDirectoryHandleOptions): Promise<IFileSystemDirectoryHandle>;
42
+ /**
43
+ * Returns a {@link FileSystemFileHandle} for a file with the specified name,
44
+ * within the directory the method is called.
45
+ *
46
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getFileHandle
47
+ * @param name A string representing the {@link NodeFileSystemHandle} name of
48
+ * the file you wish to retrieve.
49
+ * @param options An optional object containing options for the retrieved file.
50
+ */
51
+ getFileHandle(name: string, options?: GetFileHandleOptions): Promise<IFileSystemFileHandle>;
52
+ /**
53
+ * Attempts to remove an entry if the directory handle contains a file or
54
+ * directory called the name specified.
55
+ *
56
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry
57
+ * @param name A string representing the {@link FileSystemHandle} name of the
58
+ * entry you wish to remove.
59
+ * @param options An optional object containing options.
60
+ */
61
+ removeEntry(name: string, { recursive }?: RemoveEntryOptions): Promise<void>;
62
+ /**
63
+ * The `resolve()` method of the {@link FileSystemDirectoryHandle} interface
64
+ * returns an {@link Array} of directory names from the parent handle to the specified
65
+ * child entry, with the name of the child entry as the last array item.
66
+ *
67
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/resolve
68
+ * @param possibleDescendant The {@link IFileSystemHandle} from which
69
+ * to return the relative path.
70
+ */
71
+ resolve(possibleDescendant: IFileSystemHandle): Promise<string[] | null>;
72
+ }
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodeFileSystemDirectoryHandle = void 0;
4
+ const NodeFileSystemHandle_1 = require("./NodeFileSystemHandle");
5
+ const util_1 = require("./util");
6
+ const NodeFileSystemFileHandle_1 = require("./NodeFileSystemFileHandle");
7
+ /**
8
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle
9
+ */
10
+ class NodeFileSystemDirectoryHandle extends NodeFileSystemHandle_1.NodeFileSystemHandle {
11
+ constructor(fs, path, ctx = {}) {
12
+ const fullCtx = (0, util_1.ctx)(ctx);
13
+ super('directory', (0, util_1.basename)(path, fullCtx.separator));
14
+ this.fs = fs;
15
+ this.ctx = fullCtx;
16
+ this.__path = path[path.length - 1] === this.ctx.separator ? path : path + this.ctx.separator;
17
+ }
18
+ /**
19
+ * Returns a new array iterator containing the keys for each item in
20
+ * {@link NodeFileSystemDirectoryHandle} object.
21
+ *
22
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/keys
23
+ */
24
+ async *keys() {
25
+ const list = await this.fs.promises.readdir(this.__path);
26
+ for (const name of list)
27
+ yield '' + name;
28
+ }
29
+ /**
30
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/entries
31
+ */
32
+ async *entries() {
33
+ const { __path: path, fs, ctx } = this;
34
+ const list = await fs.promises.readdir(path, { withFileTypes: true });
35
+ for (const d of list) {
36
+ const dirent = d;
37
+ const name = dirent.name + '';
38
+ const newPath = path + name;
39
+ if (dirent.isDirectory())
40
+ yield [name, new NodeFileSystemDirectoryHandle(fs, newPath, ctx)];
41
+ else if (dirent.isFile())
42
+ yield [name, new NodeFileSystemFileHandle_1.NodeFileSystemFileHandle(fs, newPath, ctx)];
43
+ }
44
+ }
45
+ /**
46
+ * Returns a new array iterator containing the values for each index in the
47
+ * {@link FileSystemDirectoryHandle} object.
48
+ *
49
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/values
50
+ */
51
+ async *values() {
52
+ for await (const [, value] of this.entries())
53
+ yield value;
54
+ }
55
+ /**
56
+ * Returns a {@link NodeFileSystemDirectoryHandle} for a subdirectory with the specified
57
+ * name within the directory handle on which the method is called.
58
+ *
59
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle
60
+ * @param name A string representing the {@link NodeFileSystemHandle} name of
61
+ * the subdirectory you wish to retrieve.
62
+ * @param options An optional object containing options for the retrieved
63
+ * subdirectory.
64
+ */
65
+ async getDirectoryHandle(name, options) {
66
+ (0, util_1.assertName)(name, 'getDirectoryHandle', 'FileSystemDirectoryHandle');
67
+ const filename = this.__path + name;
68
+ const { fs } = this;
69
+ try {
70
+ const stats = await fs.promises.stat(filename);
71
+ if (!stats.isDirectory())
72
+ throw (0, util_1.newTypeMismatchError)();
73
+ return new NodeFileSystemDirectoryHandle(fs, filename, this.ctx);
74
+ }
75
+ catch (error) {
76
+ if (error instanceof DOMException)
77
+ throw error;
78
+ if (error && typeof error === 'object') {
79
+ switch (error.code) {
80
+ case 'ENOENT': {
81
+ if (options?.create) {
82
+ (0, util_1.assertCanWrite)(this.ctx.mode);
83
+ try {
84
+ await fs.promises.mkdir(filename);
85
+ }
86
+ catch (mkdirError) {
87
+ if (mkdirError && typeof mkdirError === 'object' && mkdirError.code === 'EEXIST') {
88
+ const stats = await fs.promises.stat(filename);
89
+ if (!stats.isDirectory())
90
+ throw (0, util_1.newTypeMismatchError)();
91
+ return new NodeFileSystemDirectoryHandle(fs, filename, this.ctx);
92
+ }
93
+ throw mkdirError;
94
+ }
95
+ return new NodeFileSystemDirectoryHandle(fs, filename, this.ctx);
96
+ }
97
+ throw (0, util_1.newNotFoundError)();
98
+ }
99
+ case 'EPERM':
100
+ case 'EACCES':
101
+ throw (0, util_1.newNotAllowedError)();
102
+ }
103
+ }
104
+ throw error;
105
+ }
106
+ }
107
+ /**
108
+ * Returns a {@link FileSystemFileHandle} for a file with the specified name,
109
+ * within the directory the method is called.
110
+ *
111
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getFileHandle
112
+ * @param name A string representing the {@link NodeFileSystemHandle} name of
113
+ * the file you wish to retrieve.
114
+ * @param options An optional object containing options for the retrieved file.
115
+ */
116
+ async getFileHandle(name, options) {
117
+ (0, util_1.assertName)(name, 'getFileHandle', 'FileSystemDirectoryHandle');
118
+ const filename = this.__path + name;
119
+ try {
120
+ const stats = await this.fs.promises.stat(filename);
121
+ if (!stats.isFile())
122
+ throw (0, util_1.newTypeMismatchError)();
123
+ return new NodeFileSystemFileHandle_1.NodeFileSystemFileHandle(this.fs, filename, this.ctx);
124
+ }
125
+ catch (error) {
126
+ if (error instanceof DOMException)
127
+ throw error;
128
+ if (error && typeof error === 'object') {
129
+ switch (error.code) {
130
+ case 'ENOENT': {
131
+ if (options?.create) {
132
+ (0, util_1.assertCanWrite)(this.ctx.mode);
133
+ await this.fs.promises.writeFile(filename, '');
134
+ return new NodeFileSystemFileHandle_1.NodeFileSystemFileHandle(this.fs, filename, this.ctx);
135
+ }
136
+ throw (0, util_1.newNotFoundError)();
137
+ }
138
+ case 'EPERM':
139
+ case 'EACCES':
140
+ throw (0, util_1.newNotAllowedError)();
141
+ }
142
+ }
143
+ throw error;
144
+ }
145
+ }
146
+ /**
147
+ * Attempts to remove an entry if the directory handle contains a file or
148
+ * directory called the name specified.
149
+ *
150
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry
151
+ * @param name A string representing the {@link FileSystemHandle} name of the
152
+ * entry you wish to remove.
153
+ * @param options An optional object containing options.
154
+ */
155
+ async removeEntry(name, { recursive = false } = {}) {
156
+ (0, util_1.assertCanWrite)(this.ctx.mode);
157
+ (0, util_1.assertName)(name, 'removeEntry', 'FileSystemDirectoryHandle');
158
+ const filename = this.__path + name;
159
+ const promises = this.fs.promises;
160
+ try {
161
+ const stats = await promises.stat(filename);
162
+ if (stats.isFile()) {
163
+ await promises.unlink(filename);
164
+ }
165
+ else if (stats.isDirectory()) {
166
+ await promises.rmdir(filename, { recursive });
167
+ }
168
+ else
169
+ throw (0, util_1.newTypeMismatchError)();
170
+ }
171
+ catch (error) {
172
+ if (error instanceof DOMException)
173
+ throw error;
174
+ if (error && typeof error === 'object') {
175
+ switch (error.code) {
176
+ case 'ENOENT': {
177
+ throw (0, util_1.newNotFoundError)();
178
+ }
179
+ case 'EPERM':
180
+ case 'EACCES':
181
+ throw (0, util_1.newNotAllowedError)();
182
+ case 'ENOTEMPTY':
183
+ throw new DOMException('The object can not be modified in this way.', 'InvalidModificationError');
184
+ }
185
+ }
186
+ throw error;
187
+ }
188
+ }
189
+ /**
190
+ * The `resolve()` method of the {@link FileSystemDirectoryHandle} interface
191
+ * returns an {@link Array} of directory names from the parent handle to the specified
192
+ * child entry, with the name of the child entry as the last array item.
193
+ *
194
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/resolve
195
+ * @param possibleDescendant The {@link IFileSystemHandle} from which
196
+ * to return the relative path.
197
+ */
198
+ async resolve(possibleDescendant) {
199
+ if (possibleDescendant instanceof NodeFileSystemDirectoryHandle ||
200
+ possibleDescendant instanceof NodeFileSystemFileHandle_1.NodeFileSystemFileHandle) {
201
+ const path = this.__path;
202
+ const childPath = possibleDescendant.__path;
203
+ if (!childPath.startsWith(path))
204
+ return null;
205
+ let relative = childPath.slice(path.length);
206
+ if (relative === '')
207
+ return [];
208
+ const separator = this.ctx.separator;
209
+ if (relative[0] === separator)
210
+ relative = relative.slice(1);
211
+ return relative.split(separator);
212
+ }
213
+ return null;
214
+ }
215
+ }
216
+ exports.NodeFileSystemDirectoryHandle = NodeFileSystemDirectoryHandle;
217
+ //# sourceMappingURL=NodeFileSystemDirectoryHandle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeFileSystemDirectoryHandle.js","sourceRoot":"","sources":["../src/NodeFileSystemDirectoryHandle.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAC9D,iCAQgB;AAChB,yEAAsE;AAYtE;;GAEG;AACH,MAAa,6BAA8B,SAAQ,2CAAoB;IAKrE,YACqB,EAAa,EAChC,IAAY,EACZ,MAA+B,EAAE;QAEjC,MAAM,OAAO,GAAG,IAAA,UAAS,EAAC,GAAG,CAAC,CAAC;QAC/B,KAAK,CAAC,WAAW,EAAE,IAAA,eAAQ,EAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QALnC,OAAE,GAAF,EAAE,CAAW;QAMhC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;IA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;CACF;AA5MD,sEA4MC"}
@@ -0,0 +1,28 @@
1
+ import { NodeFileSystemHandle } from './NodeFileSystemHandle';
2
+ import { NodeFileSystemWritableFileStream } from './NodeFileSystemWritableFileStream';
3
+ import type { NodeFsaContext, NodeFsaFs } from './types';
4
+ import type { IFileSystemFileHandle, IFileSystemSyncAccessHandle } from '@jsonjoy.com/fs-fsa';
5
+ export declare class NodeFileSystemFileHandle extends NodeFileSystemHandle implements IFileSystemFileHandle {
6
+ protected readonly fs: NodeFsaFs;
7
+ readonly __path: string;
8
+ protected readonly ctx: NodeFsaContext;
9
+ constructor(fs: NodeFsaFs, __path: string, ctx?: Partial<NodeFsaContext>);
10
+ /**
11
+ * Returns a {@link Promise} which resolves to a {@link File} object
12
+ * representing the state on disk of the entry represented by the handle.
13
+ *
14
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/getFile
15
+ */
16
+ getFile(): Promise<File>;
17
+ /**
18
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createSyncAccessHandle
19
+ */
20
+ get createSyncAccessHandle(): undefined | (() => Promise<IFileSystemSyncAccessHandle>);
21
+ /**
22
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable
23
+ */
24
+ createWritable({ keepExistingData }?: CreateWritableOptions): Promise<NodeFileSystemWritableFileStream>;
25
+ }
26
+ export interface CreateWritableOptions {
27
+ keepExistingData?: boolean;
28
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodeFileSystemFileHandle = void 0;
4
+ const NodeFileSystemHandle_1 = require("./NodeFileSystemHandle");
5
+ const NodeFileSystemSyncAccessHandle_1 = require("./NodeFileSystemSyncAccessHandle");
6
+ const util_1 = require("./util");
7
+ const NodeFileSystemWritableFileStream_1 = require("./NodeFileSystemWritableFileStream");
8
+ class NodeFileSystemFileHandle extends NodeFileSystemHandle_1.NodeFileSystemHandle {
9
+ constructor(fs, __path, ctx = {}) {
10
+ ctx = (0, util_1.ctx)(ctx);
11
+ super('file', (0, util_1.basename)(__path, ctx.separator));
12
+ this.fs = fs;
13
+ this.__path = __path;
14
+ this.ctx = ctx;
15
+ }
16
+ /**
17
+ * Returns a {@link Promise} which resolves to a {@link File} object
18
+ * representing the state on disk of the entry represented by the handle.
19
+ *
20
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/getFile
21
+ */
22
+ async getFile() {
23
+ try {
24
+ const path = this.__path;
25
+ const promises = this.fs.promises;
26
+ const stats = await promises.stat(path);
27
+ // TODO: Once implemented, use promises.readAsBlob() instead of promises.readFile().
28
+ const data = await promises.readFile(path);
29
+ const file = new File([data], this.name, { lastModified: stats.mtime.getTime() });
30
+ return file;
31
+ }
32
+ catch (error) {
33
+ if (error instanceof DOMException)
34
+ throw error;
35
+ if (error && typeof error === 'object') {
36
+ switch (error.code) {
37
+ case 'EPERM':
38
+ case 'EACCES':
39
+ throw (0, util_1.newNotAllowedError)();
40
+ }
41
+ }
42
+ throw error;
43
+ }
44
+ }
45
+ /**
46
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createSyncAccessHandle
47
+ */
48
+ get createSyncAccessHandle() {
49
+ if (!this.ctx.syncHandleAllowed)
50
+ return undefined;
51
+ return async () => {
52
+ if (this.ctx.locks.isLocked(this.__path)) {
53
+ throw (0, util_1.newNoModificationAllowedError)();
54
+ }
55
+ return new NodeFileSystemSyncAccessHandle_1.NodeFileSystemSyncAccessHandle(this.fs, this.__path, this.ctx);
56
+ };
57
+ }
58
+ /**
59
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable
60
+ */
61
+ async createWritable({ keepExistingData = false } = { keepExistingData: false }) {
62
+ (0, util_1.assertCanWrite)(this.ctx.mode);
63
+ if (this.ctx.locks.isLocked(this.__path)) {
64
+ throw (0, util_1.newNoModificationAllowedError)();
65
+ }
66
+ return new NodeFileSystemWritableFileStream_1.NodeFileSystemWritableFileStream(this.fs, this.__path, keepExistingData, this.ctx);
67
+ }
68
+ }
69
+ exports.NodeFileSystemFileHandle = NodeFileSystemFileHandle;
70
+ //# sourceMappingURL=NodeFileSystemFileHandle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeFileSystemFileHandle.js","sourceRoot":"","sources":["../src/NodeFileSystemFileHandle.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAC9D,qFAAkF;AAClF,iCAAuH;AACvH,yFAAsF;AAItF,MAAa,wBAAyB,SAAQ,2CAAoB;IAGhE,YACqB,EAAa,EAChB,MAAc,EAC9B,MAA+B,EAAE;QAEjC,GAAG,GAAG,IAAA,UAAS,EAAC,GAAG,CAAC,CAAC;QACrB,KAAK,CAAC,MAAM,EAAE,IAAA,eAAQ,EAAC,MAAM,EAAE,GAAG,CAAC,SAAU,CAAC,CAAC,CAAC;QAL7B,OAAE,GAAF,EAAE,CAAW;QAChB,WAAM,GAAN,MAAM,CAAQ;QAK9B,IAAI,CAAC,GAAG,GAAG,GAAqB,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO;QAClB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;YACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC;YAClC,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxC,oFAAoF;YACpF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAgB,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC9F,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAA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