Skip to content

Commit

Permalink
Remove IsURLOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikra authored and NoNameProvided committed Nov 4, 2018
1 parent 972ca4b commit 8faf2fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 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, IsURLOptions, IsNumberOptions} from "../validation/ValidationTypeOptions";
import {IsEmailOptions, IsNumberOptions} from "../validation/ValidationTypeOptions";
import {ValidationOptions} from "./ValidationOptions";
import {ValidationMetadata} from "../metadata/ValidationMetadata";
import {ValidationMetadataArgs} from "../metadata/ValidationMetadataArgs";
Expand Down Expand Up @@ -927,7 +927,7 @@ export function IsSurrogatePair(validationOptions?: ValidationOptions) {
/**
* Checks if the string is an url.
*/
export function IsUrl(options?: IsURLOptions, validationOptions?: ValidationOptions) {
export function IsUrl(options?: ValidatorJS.IsURLOptions, validationOptions?: ValidationOptions) {
return function (object: Object, propertyName: string) {
const args: ValidationMetadataArgs = {
type: ValidationTypes.IS_URL,
Expand Down
15 changes: 0 additions & 15 deletions src/validation/ValidationTypeOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ export interface IsNumberOptions {
allowInfinity?: boolean;
}

/**
* Options to be passed to IsURL decorator.
*/
export interface IsURLOptions {
protocols?: string[];
require_tld?: boolean;
require_protocol?: boolean;
require_valid_protocol?: boolean;
allow_underscores?: boolean;
host_whitelist?: false | (string | RegExp)[];
host_blacklist?: false | (string | RegExp)[];
allow_trailing_dot?: boolean;
allow_protocol_relative_urls?: boolean;
}

/**
* Options to be passed to isEmail decorator.
*/
Expand Down
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, IsURLOptions, IsNumberOptions} from "./ValidationTypeOptions";
import {IsEmailOptions, IsNumberOptions} from "./ValidationTypeOptions";
import {ValidatorOptions} from "./ValidatorOptions";
import {ValidationExecutor} from "./ValidationExecutor";
import {ValidationOptions} from "../decorator/ValidationOptions";
Expand Down Expand Up @@ -696,7 +696,7 @@ export class Validator {
* Checks if the string is an url.
* If given value is not a string, then it returns false.
*/
isURL(value: string, options?: IsURLOptions): boolean {
isURL(value: string, options?: ValidatorJS.IsURLOptions): boolean {
return typeof value === "string" && this.validatorJs.isURL(value, options);
}

Expand Down

0 comments on commit 8faf2fc

Please sign in to comment.