Skip to content

FileLegacyMode

type FileLegacyMode = "ignore" | "warn" | "read-through";

Defined in: src/storage/file.ts:53

How createFileStorage treats leaves in the legacy (pre-encoding, raw segment) layout:

  • "ignore" (default): they are invisible;
  • "warn": invisible, and onLegacy is called once (by default a console.warn that points at migrateFileStorage);
  • "read-through": getItem falls back to the legacy file when the encoded one is missing, getKeys lists legacy leaves too, and the next write or remove of that key deletes the legacy file.