mirror of
https://github.com/eliasrenman/gardentron.git
synced 2026-03-16 20:46:07 +01:00
chore: setup featherjs project
This commit is contained in:
29
server/src/validators.ts
Normal file
29
server/src/validators.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// For more information about this file see https://dove.feathersjs.com/guides/cli/validators.html
|
||||
import { Ajv, addFormats } from '@feathersjs/schema'
|
||||
import type { FormatsPluginOptions } from '@feathersjs/schema'
|
||||
|
||||
const formats: FormatsPluginOptions = [
|
||||
'date-time',
|
||||
'time',
|
||||
'date',
|
||||
'email',
|
||||
'hostname',
|
||||
'ipv4',
|
||||
'ipv6',
|
||||
'uri',
|
||||
'uri-reference',
|
||||
'uuid',
|
||||
'uri-template',
|
||||
'json-pointer',
|
||||
'relative-json-pointer',
|
||||
'regex'
|
||||
]
|
||||
|
||||
export const dataValidator: Ajv = addFormats(new Ajv({}), formats)
|
||||
|
||||
export const queryValidator: Ajv = addFormats(
|
||||
new Ajv({
|
||||
coerceTypes: true
|
||||
}),
|
||||
formats
|
||||
)
|
||||
Reference in New Issue
Block a user