sveltekit-flash-message
Version:
Send temporary data to the next request after redirect. Works with both SSR and client.
22 lines (21 loc) • 485 B
JavaScript
export const defaultOptions = {
clearArray: false,
clearOnNavigate: true,
clearAfterMs: 0,
flashCookieOptions: {
path: '/',
maxAge: 120,
httpOnly: false,
sameSite: 'strict'
}
};
export function mergeOptions(parentOptions, options) {
return {
...parentOptions,
...options,
flashCookieOptions: {
...parentOptions.flashCookieOptions,
...options?.flashCookieOptions
}
};
}