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

Method has

src/session.ts:299–301  ·  view source on GitHub ↗

* Checks if a key exists inside the datastore * * @param key - The key to check for existence * * @example * if (session.has('username')) { * console.log('User is logged in') * }

(key: string)

Source from the content-addressed store, hash-verified

297 * }
298 */
299 has(key: string): boolean {
300 return this.#getValuesStore('read').has(key)
301 }
302
303 /**
304 * Gets the value of a key from the session datastore.

Callers 5

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

Calls 1

#getValuesStoreMethod · 0.95

Tested by

no test coverage detected