Skip to content

Commit af2a44e

Browse files
committed
fix: use z instead of joi
1 parent ec690a4 commit af2a44e

File tree

3 files changed

+2
-90
lines changed

3 files changed

+2
-90
lines changed

package-lock.json

Lines changed: 0 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"glob": "^10.3.10",
1818
"gpt-tokenizer": "^2.1.2",
1919
"inquirer": "^9.2.12",
20-
"joi": "^17.11.0",
2120
"playwright": "*",
2221
"prettier": "^3.1.0",
2322
"swagger-ui-express": "^5.0.0"

src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import express from 'express';
22
import cors from 'cors';
33
import { readFile } from 'fs/promises';
44
import { crawl, write } from "./core.js";
5-
import { Config, ConfigSchema } from './config.js';
5+
import { Config, configSchema } from './config.js';
66
import { configDotenv } from 'dotenv';
77
import swaggerUi from 'swagger-ui-express';
88
// @ts-ignore
@@ -22,7 +22,7 @@ app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
2222
app.post('/crawl', async (req, res) => {
2323
const config: Config = req.body;
2424
try {
25-
const validatedConfig = ConfigSchema.validate(config).value;
25+
const validatedConfig = configSchema.parse(config);
2626
await crawl(validatedConfig);
2727
await write(validatedConfig);
2828
const outputFileContent = await readFile(validatedConfig.outputFileName, 'utf-8');

0 commit comments

Comments
 (0)