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

Method flashExcept

src/session.ts:507–517  ·  view source on GitHub ↗

* Flashes form input data (except some keys) to the flash messages store * * @param keys - Array of keys to exclude from flashing * * @example * session.flashExcept(['password', '_csrf'])

(keys: string[])

Source from the content-addressed store, hash-verified

505 * session.flashExcept(['password', '_csrf'])
506 */
507 flashExcept(keys: string[]): void {
508 this.#getFlashStore('write').set(
509 'input',
510 lodash.omitBy(this.#ctx.request.original(), (value, key) => {
511 if (keys.includes(key)) {
512 return true
513 }
514 return !this.shouldFlashValue(value)
515 })
516 )
517 }
518
519 /**
520 * Flashes form input data (only some keys) to the flash messages store

Callers 2

flashValidationErrorsMethod · 0.95
session.spec.tsFile · 0.80

Calls 3

#getFlashStoreMethod · 0.95
shouldFlashValueMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected