Primeiro commit
This commit is contained in:
commit
9135911bd7
33 changed files with 48927 additions and 0 deletions
19
ferramentas/ambiente.ts
Normal file
19
ferramentas/ambiente.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { z } from "zod";
|
||||
import { PORTA, PREFIXO } from "../PREFIXO";
|
||||
|
||||
const validar = z
|
||||
.object({
|
||||
PORTA: z.string(),
|
||||
PREFIXO: z.string().regex(/^\/\w+$/),
|
||||
})
|
||||
.safeParse({ PORTA, PREFIXO });
|
||||
|
||||
if ("error" in validar) {
|
||||
throw new Error(
|
||||
validar.error.errors
|
||||
.map((erro) => `${erro.path}: ${erro.message}`)
|
||||
.join("\n"),
|
||||
);
|
||||
}
|
||||
|
||||
export const ambiente = validar.data;
|
||||
Loading…
Add table
Add a link
Reference in a new issue