mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
fix: ignore empty values for STAFF/DEFAULT_ALLOWED_SERVERS
This commit is contained in:
parent
22d0b14ef1
commit
9bd1b97a11
1 changed files with 20 additions and 2 deletions
|
@ -15,9 +15,27 @@ const envType = z.object({
|
|||
API_URL: z.string().url(),
|
||||
API_PORT: z.preprocess((v) => Number(v), z.number().min(1).max(65535)).default(3000),
|
||||
|
||||
STAFF: z.preprocess((v) => String(v).split(","), z.array(z.string())).optional(),
|
||||
STAFF: z
|
||||
.preprocess(
|
||||
(v) =>
|
||||
String(v)
|
||||
.split(",")
|
||||
.map((s) => s.trim())
|
||||
.filter((s) => s !== ""),
|
||||
z.array(z.string()),
|
||||
)
|
||||
.optional(),
|
||||
|
||||
DEFAULT_ALLOWED_SERVERS: z.preprocess((v) => String(v).split(","), z.array(z.string())).optional(),
|
||||
DEFAULT_ALLOWED_SERVERS: z
|
||||
.preprocess(
|
||||
(v) =>
|
||||
String(v)
|
||||
.split(",")
|
||||
.map((s) => s.trim())
|
||||
.filter((s) => s !== ""),
|
||||
z.array(z.string()),
|
||||
)
|
||||
.optional(),
|
||||
|
||||
PHISHERMAN_API_KEY: z.string().optional(),
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue