MCPcopy Create free account
hub / github.com/adonisjs/session / #getValuesStore

Method #getValuesStore

src/session.ts:213–223  ·  view source on GitHub ↗

* Returns the store instance for a given mode * * @param mode - Access mode ('write' or 'read')

(mode: 'write' | 'read')

Source from the content-addressed store, hash-verified

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.

Callers 9

putMethod · 0.95
hasMethod · 0.95
getMethod · 0.95
allMethod · 0.95
forgetMethod · 0.95
pullMethod · 0.95
incrementMethod · 0.95
decrementMethod · 0.95
clearMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected