DIR : /home/kozerus/public_html/cropex/node/node_modules/@hookform/resolvers/io-ts/src/io-ts.ts
/home/kozerus/public_html/cropex/node/node_modules/@hookform/resolvers/io-ts/src
import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';
import * as Either from 'fp-ts/Either';
import { pipe } from 'fp-ts/function';
import errorsToRecord from './errorsToRecord';
import { Resolver } from './types';
export const ioTsResolver: Resolver = (codec) => (values, _context, options) =>
pipe(
values,
codec.decode,
Either.mapLeft(
errorsToRecord(
!options.shouldUseNativeValidation && options.criteriaMode === 'all',
),
),
Either.mapLeft((errors) => toNestErrors(errors, options)),
Either.fold(
(errors) => ({
values: {},
errors,
}),
(values) => {
options.shouldUseNativeValidation &&
validateFieldsNatively({}, options);
return {
values,
errors: {},
} as any;
},
),
);
//
koh5_pano
Drag mouse to navigate.
Navigation
- Left/Right Mouse drag: Changes camera heading.
- Up/Sown Mouse drag: Changes camera pitch.
- Scroll wheel: Changes camera field of view.
- I-Key: Displays Info panel with canvas size, image size and FPS.
17.Aug.2010, Martin Wengenmayer