Skip to content

Commit e3a3da1

Browse files
committed
Extend useAjvForm schema with SchemaObject
1 parent 3660c08 commit e3a3da1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@programmer_network/use-ajv-form",
3-
"version": "1.0.17",
3+
"version": "1.0.18",
44
"description": "Custom React Hook that integrates with Ajv JSON Schema Validator",
55
"main": "dist/use-ajv-form.es.js",
66
"author": "Aleksandar Grbic",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
22
import { addUserDefinedKeywords, getErrors, getInitial, getValue } from './utils';
33
import { ajv } from './utils/validation';
44

5-
import { ErrorObject, JSONSchemaType, KeywordDefinition } from 'ajv';
5+
import { ErrorObject, JSONSchemaType, KeywordDefinition, SchemaObject } from 'ajv';
66
import { useDebounce } from './Hooks/useDebounce';
77
import {
88
AJVMessageFunction,
@@ -14,7 +14,7 @@ import {
1414

1515
const useAJVForm = <T extends Record<string, any>>(
1616
initial: T,
17-
schema: JSONSchemaType<T>,
17+
schema: JSONSchemaType<T> | SchemaObject,
1818
options?: {
1919
customKeywords?: KeywordDefinition[];
2020
errors?: ErrorObject[];

0 commit comments

Comments
 (0)