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

Method has

src/session.ts:310–312  ·  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

308 * }
309 */
310 has(key: string): boolean {
311 return this.#getValuesStore('read').has(key)
312 }
313
314 /**
315 * Gets the value of a key from the session datastore.

Callers 11

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

Calls 1

#getValuesStoreMethod · 0.95

Tested by

no test coverage detected