Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ describe('genericValidator', () => {
} as Parameters<ValidationFunc>[0]);
expect(result).toBeUndefined();
});

it('should return undefined if the value contains dashes', () => {
const result = genericValidator({
value: 'valid-value',
path: 'generic',
} as Parameters<ValidationFunc>[0]);
expect(result).toBeUndefined();
});
});

describe('domainValidator', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const normalizeValueType = (value: string): keyof typeof fieldsConfig.val
};

const DOMAIN_REGEX = /^(?!-)[A-Za-z0-9-]{1,63}(?<!-)\.[A-Za-z]{2,}$/;
const GENERIC_REGEX = /^[a-zA-Z0-9._:/\\]+$/;
const GENERIC_REGEX = /^[a-zA-Z0-9._:/\\-]+$/;

const notStringError = (path: string) => ({
code: 'ERR_NOT_STRING',
Expand Down