* Returns the store instance for a given mode * * @param mode - Access mode ('write' or 'read')
(mode: 'write' | 'read')
| 211 | * @param mode - Access mode ('write' or 'read') |
| 212 | */ |
| 213 | #getValuesStore(mode: 'write' | 'read'): ValuesStore { |
| 214 | if (!this.#valuesStore) { |
| 215 | throw new errors.E_SESSION_NOT_READY() |
| 216 | } |
| 217 | |
| 218 | if (mode === 'write' && this.readonly) { |
| 219 | throw new errors.E_SESSION_NOT_MUTABLE() |
| 220 | } |
| 221 | |
| 222 | return this.#valuesStore |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * Initiates the session store. The method results in a noop when called multiple times. |