Skip to content

Commit

Permalink
refactor: changed options validator name
Browse files Browse the repository at this point in the history
  • Loading branch information
CptSchnitz committed Jun 30, 2024
1 parent 72b525b commit f92b966
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import deepmerge from 'deepmerge';
import { BaseOptions, optionsSchema } from './types';
import { ajvLibraryConfigValidator, validate } from './validator';
import { ajvOptionsValidator, validate } from './validator';
import { createDebug } from './utils/debug';
import { createConfigError } from './errors';

Expand Down Expand Up @@ -29,7 +29,7 @@ export function initializeOptions(options: Partial<BaseOptions>): BaseOptions {

debug('merged options: %j', mergedOptions);

const [errors, validatedOptions] = validate(ajvLibraryConfigValidator, optionsSchema, mergedOptions);
const [errors, validatedOptions] = validate(ajvOptionsValidator, optionsSchema, mergedOptions);

if (errors) {
debug('error validating options: %s', errors[0].message);
Expand Down
2 changes: 1 addition & 1 deletion src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ajvConfigValidator = addFormats(
['date-time', 'time', 'date', 'email', 'hostname', 'ipv4', 'ipv6', 'uri', 'uuid', 'regex', 'uri-template']
);

export const ajvLibraryOptionsValidator = new Ajv({
export const ajvOptionsValidator = new Ajv({
useDefaults: true,
coerceTypes: true,
allErrors: true,
Expand Down

0 comments on commit f92b966

Please sign in to comment.