F. js / Sesion.js

1import { exportaAHtml } from "../lib/js/exportaAHtml.js"
2import { CUE } from "./CUE.js"
3import { ROL_IDS } from "./ROL_IDS.js"
4
5export class Sesion {
6
7 /**
8 * @param { any } objeto
9 */
10 constructor(objeto) {
11
12 /**
13 * @readonly
14 */
15 this.cue = objeto[CUE]
16 if (typeof this.cue !== "string")
17 throw new Error("cue debe ser string.")
18
19 /**
20 * @readonly
21 */
22 const rolIds = objeto[ROL_IDS]
23 if (!Array.isArray(rolIds))
24 throw new Error("rolIds debe ser arreglo.")
25 /**
26 * @readonly
27 */
28 this.rolIds = new Set(rolIds)
29
30 }
31
32}
33
34exportaAHtml(Sesion)
skip_previous skip_next