* Filters flash data to only include values that should be flashed. * Removes values that have opted out of flash storage. * * @param data - Flash data to filter
(data: T)
| 193 | * @param data - Flash data to filter |
| 194 | */ |
| 195 | protected cleanupFlashData<T>(data: T): T | Record<string, any> { |
| 196 | if (is.plainObject(data)) { |
| 197 | return Object.keys(data).reduce<Record<string, any>>((result, key) => { |
| 198 | const value = data[key] |
| 199 | if (this.shouldFlashValue(value)) { |
| 200 | result[key] = value |
| 201 | } |
| 202 | return result |
| 203 | }, {}) |
| 204 | } |
| 205 | return data |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * Returns the store instance for a given mode |
no test coverage detected