mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
feat: add zod-deep-partial, partialValidator on InputSpec, and z.deepPartial re-export
This commit is contained in:
@@ -8,6 +8,20 @@ export * as types from './types'
|
||||
export * as T from './types'
|
||||
export * as yaml from 'yaml'
|
||||
export * as inits from './inits'
|
||||
export { z } from 'zod'
|
||||
import { z as _z } from 'zod'
|
||||
import { zodDeepPartial } from 'zod-deep-partial'
|
||||
import { DeepPartial } from './types'
|
||||
|
||||
type ZodDeepPartial = <T>(a: _z.ZodType<T>) => _z.ZodType<DeepPartial<T>>
|
||||
|
||||
export const z: typeof _z & {
|
||||
deepPartial: ZodDeepPartial
|
||||
} = Object.assign(_z, { deepPartial: zodDeepPartial as ZodDeepPartial })
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
export namespace z {
|
||||
export type infer<T extends { _zod: { output: any } }> = T['_zod']['output']
|
||||
export type input<T extends { _zod: { input: any } }> = T['_zod']['input']
|
||||
export type output<T extends { _zod: { output: any } }> = T['_zod']['output']
|
||||
}
|
||||
|
||||
export * as utils from './util'
|
||||
|
||||
Reference in New Issue
Block a user