encodeFileSegment
function encodeFileSegment(part): string;Encode one path segment.
Three names get special handling because a filesystem reads them as something
other than a name: . and .. are directory entries, and the Windows device
names above are hardware. In each case the first character is escaped, which
is enough to make the segment inert while leaving it readable and reversible.
Known limitation — case-insensitive filesystems. macOS (APFS default) and
Windows (NTFS) fold case, so owners differing only by case — Alice and
alice — resolve to one directory here. Encoding the case away would make
every ordinary name unreadable (USER.md becomes %55%53%45%52.md), which
costs the human-editable-markdown property this store deliberately offers.
Closing it is a layout decision rather than a bug fix; see the board task
“Decide how the file memory store survives a case-insensitive filesystem”.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”string