A simple fix is to use fixSlash already in make-index.js each place where entries.set is called.
However, it may be best to also make the logic that consumes the index more robust by handling both types of path separators... just in case someone creates their own filesystem index, I suppose.
I believe it would best to normalize the paths before placing them into the index. This is easily accomplished by using relative and resolve from node:path/posix instead of node:path.
On Windows, the
make-index
command outputs JSON with entries having backslashes in the keys, e.g.:When the generated index with
FetchFS
, it lists every file in the folder structure as if it were a file at the root, whose name contains backslashes.For example, running
ZenFS.fs.readdirSync("/")
I got:Where I expected:
A simple fix is to use
fixSlash
already inmake-index.js
each place whereentries.set
is called.However, it may be best to also make the logic that consumes the index more robust by handling both types of path separators... just in case someone creates their own filesystem index, I suppose.