fix handle.kind
Release / release (push) Successful in 23s

This commit is contained in:
2026-05-01 11:03:08 -07:00
parent f361c6b931
commit 40424dde59
3 changed files with 8 additions and 1 deletions
+1
View File
@@ -16,6 +16,7 @@ export default class NodeFileSystemDirectoryHandle extends NodeFileSystemHandle
declare kind: "directory";
constructor(path: string, options: FileSystemGetDirectoryOptions & { origin?: NodeFileSystemDirectoryHandle } = {}) {
super(path, options)
this.kind="directory"
try {
const stats = fs.statSync(this.path)
if (!stats.isDirectory()) throw new Error("tried to open file as directory: " + this.path)
+1
View File
@@ -17,6 +17,7 @@ export default class NodeFileSystemFileHandle extends NodeFileSystemHandle imple
declare kind: "file";
constructor(path: string, options: FileSystemGetFileOptions & { origin?: NodeFileSystemDirectoryHandle } = {}) {
super(path,options)
this.kind="file"
let flags = fs.constants.O_RDWR
if (options.create) flags |= fs.constants.O_CREAT
fs.closeSync(fs.openSync(this.path, flags))