first commit

This commit is contained in:
Your Name
2026-09-08 11:40:15 +08:00
commit a5353f7eb5
9568 changed files with 1646214 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import dotenv from 'dotenv'
dotenv.config({ path: `.env.${process.env.NODE_ENV}` })
const ENV_PREFIX = 'NUXT_'
export const getEnvConfig = () => {
const config: Record<string, any> = {}
Object.keys(process.env).forEach((evnKey) => {
if (evnKey.includes(ENV_PREFIX)) {
const key = evnKey
.replace(ENV_PREFIX, '')
.toLowerCase()
.replace(/\_([A-Za-z])/g, function (all, $1) {
return $1.toUpperCase()
})
config[key] = process.env[evnKey]
}
})
return config
}