mirror of
https://github.com/Nezumi-2711/Sink.git
synced 2026-09-23 04:09:56 +00:00
feat: init
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import type { H3Event } from 'h3'
|
||||
|
||||
export function getExpiration(event: H3Event, expiration: number | undefined) {
|
||||
const { previewMode } = useRuntimeConfig(event).public
|
||||
if (previewMode) {
|
||||
const { previewTTL } = useAppConfig(event)
|
||||
const previewExpiration = Math.floor(Date.now() / 1000) + previewTTL
|
||||
if (!expiration || expiration > previewExpiration)
|
||||
expiration = Math.floor(Date.now() / 1000) + previewTTL
|
||||
}
|
||||
|
||||
return expiration
|
||||
}
|
||||
Reference in New Issue
Block a user