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

Method set

src/values_store.ts:167–170  ·  view source on GitHub ↗

* Sets a key/value pair in the store * * @param key - The key or key path to set * @param value - The value to set * * @example * store.set('username', 'john') * store.set(['user', 'preferences'], { theme: 'dark' })

(key: string | string[], value: AllowedSessionValues)

Source from the content-addressed store, hash-verified

165 * store.set(['user', 'preferences'], { theme: 'dark' })
166 */
167 set(key: string | string[], value: AllowedSessionValues): void {
168 this.#modified = true
169 lodash.set(this.values, key, value)
170 }
171
172 /**
173 * Removes a key from the store

Callers 15

incrementMethod · 0.95
decrementMethod · 0.95
commitMethod · 0.80
putMethod · 0.80
flashMethod · 0.80
flashAllMethod · 0.80
flashExceptMethod · 0.80
flashOnlyMethod · 0.80
reflashMethod · 0.80
reflashOnlyMethod · 0.80
reflashExceptMethod · 0.80
writeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected