MCPcopy Create free account
hub / github.com/adonisjs/session / pull

Method pull

src/session.ts:352–354  ·  view source on GitHub ↗

* Reads value for a key from the session datastore and removes it simultaneously * * @param key - The key to pull * @param defaultValue - Default value to return if key doesn't exist * * @example * const message = session.pull('notification', 'No messages') * // message contains

(key: string, defaultValue?: any)

Source from the content-addressed store, hash-verified

350 * // message contains the value, and it's removed from session
351 */
352 pull(key: string, defaultValue?: any) {
353 return this.#getValuesStore('write').pull(key, defaultValue)
354 }
355
356 /**
357 * Increments the value of a key inside the session store.

Callers 5

initiateMethod · 0.95
pullIntendedUrlMethod · 0.95
session.spec.tsFile · 0.45

Calls 1

#getValuesStoreMethod · 0.95

Tested by

no test coverage detected