This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/lowdb/lib/adapters/browser/WebStorage.js
T

19 lines
408 B
JavaScript

export class WebStorage {
#key;
#storage;
constructor(key, storage) {
this.#key = key;
this.#storage = storage;
}
read() {
const value = this.#storage.getItem(this.#key);
if (value === null) {
return null;
}
return JSON.parse(value);
}
write(obj) {
this.#storage.setItem(this.#key, JSON.stringify(obj));
}
}