mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-25 15:06:41 +07:00
initial
This commit is contained in:
commit
ddefc2743a
21 changed files with 873 additions and 0 deletions
13
src/config/validate.ts
Normal file
13
src/config/validate.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { object } from 'yup'
|
||||
import { httpConfigSchema } from '../api/http/validation';
|
||||
import { Config } from './types';
|
||||
import { vkConfigSchema } from '../service/vk/validation';
|
||||
import { telegramConfigSchema } from '../service/telegram/validation';
|
||||
|
||||
const configSchema = object<Config>().required().shape({
|
||||
http: httpConfigSchema,
|
||||
vk: vkConfigSchema,
|
||||
telegram: telegramConfigSchema,
|
||||
})
|
||||
|
||||
export const validateConfig = (config: Config) => configSchema.validateSync(config)
|
Loading…
Add table
Add a link
Reference in a new issue