Merge pull request #831 from rewse/fix/cli-entrypoint-polyfill-default

fix(cli): handle incomplete localStorage in Node.js v25+
This commit is contained in:
vorotamoroz
2026-03-26 20:36:46 +09:00
committed by GitHub

View File

@@ -3,7 +3,7 @@
* Command-line version of Self-hosted LiveSync plugin for syncing vaults without Obsidian
*/
if (!("localStorage" in globalThis)) {
if (!("localStorage" in globalThis) || typeof (globalThis as any).localStorage?.getItem !== "function") {
const store = new Map<string, string>();
(globalThis as any).localStorage = {
getItem: (key: string) => (store.has(key) ? store.get(key)! : null),