Skip to content

Commit

Permalink
Remove IsFQDNOptions from repo
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikra authored and NoNameProvided committed Nov 4, 2018
1 parent 6400a07 commit 972ca4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/decorator/decorators.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ValidationTypes} from "../validation/ValidationTypes";
import {IsEmailOptions, IsFQDNOptions, IsURLOptions, IsNumberOptions} from "../validation/ValidationTypeOptions";
import {IsEmailOptions, IsURLOptions, IsNumberOptions} from "../validation/ValidationTypeOptions";
import {ValidationOptions} from "./ValidationOptions";
import {ValidationMetadata} from "../metadata/ValidationMetadata";
import {ValidationMetadataArgs} from "../metadata/ValidationMetadataArgs";
Expand Down Expand Up @@ -663,7 +663,7 @@ export function IsEmail(options?: IsEmailOptions, validationOptions?: Validation
/**
* Checks if the string is a fully qualified domain name (e.g. domain.com).
*/
export function IsFQDN(options?: IsFQDNOptions, validationOptions?: ValidationOptions) {
export function IsFQDN(options?: ValidatorJS.IsFQDNOptions, validationOptions?: ValidationOptions) {
return function (object: Object, propertyName: string) {
const args: ValidationMetadataArgs = {
type: ValidationTypes.IS_FQDN,
Expand Down
11 changes: 1 addition & 10 deletions src/validation/ValidationTypeOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,4 @@ export interface IsEmailOptions {
allow_display_name?: boolean;
allow_utf8_local_part?: boolean;
require_tld?: boolean;
}

/**
* Options to be passed to IsFQDN decorator.
*/
export interface IsFQDNOptions {
require_tld?: boolean;
allow_underscores?: boolean;
allow_trailing_dot?: boolean;
}
}
4 changes: 2 additions & 2 deletions src/validation/Validator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ValidationMetadata} from "../metadata/ValidationMetadata";
import {ValidationTypes} from "./ValidationTypes";
import {ValidationError} from "./ValidationError";
import {IsEmailOptions, IsFQDNOptions, IsURLOptions, IsNumberOptions} from "./ValidationTypeOptions";
import {IsEmailOptions, IsURLOptions, IsNumberOptions} from "./ValidationTypeOptions";
import {ValidatorOptions} from "./ValidatorOptions";
import {ValidationExecutor} from "./ValidationExecutor";
import {ValidationOptions} from "../decorator/ValidationOptions";
Expand Down Expand Up @@ -550,7 +550,7 @@ export class Validator {
* Checks if the string is a fully qualified domain name (e.g. domain.com).
* If given value is not a string, then it returns false.
*/
isFQDN(value: string, options?: IsFQDNOptions): boolean {
isFQDN(value: string, options?: ValidatorJS.IsFQDNOptions): boolean {
return typeof value === "string" && this.validatorJs.isFQDN(value, options);
}

Expand Down

0 comments on commit 972ca4b

Please sign in to comment.