@thinkboat/wechatjs
Version:
企业微信API SDK for Node
24 lines (18 loc) • 460 B
text/typescript
import { SessionStorage } from ".";
export class MemoryStorage implements SessionStorage {
private data: Record<string, unknown>
constructor() {
this.data = {}
}
get(key: string) {
return this.data[key]
}
set(key: string, value: unknown, ttl?: number) {
if (value) {
this.data[key] = value
}
};
delete(key: string) {
delete this.data[key]
};
}