filefive
Version:
SFTP/FTP/Amazon S3 client and dual-panel file manager for macOS and Linux
23 lines (22 loc) • 613 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const node_crypto_1 = require("node:crypto");
class Session {
static create() {
const sid = (0, node_crypto_1.randomUUID)();
this.sessions.set(sid, {});
return sid;
}
static remove(sid) {
this.sessions.delete(sid);
}
static get(sid) {
return this.sessions.get(sid);
}
static set(sid, settings) {
const s = this.sessions.get(sid);
s && this.sessions.set(sid, Object.assign(s, settings));
}
}
Session.sessions = new Map();
exports.default = Session;