refactor utils

This commit is contained in:
wancat committed 2024-02-19 18:05:00 +08:00
1 parent 9509bbc355
commit d6c95cea4a
13 files changed
+126 -31

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import crypto from 'crypto'
export function get<T>(key: string, defaultValue: T): T {
const value = process.env[key]
return value !== undefined ? (value as unknown as T) : defaultValue
}
export function genSecret() {
return crypto.randomUUID()
}