Skip to content

Commit b57c40e

Browse files
author
Umed Khudoiberdiev
committedNov 15, 2015
switched from gulpfile.ts to gulpclass
1 parent fe3da1e commit b57c40e

File tree

11 files changed

+78
-78
lines changed

11 files changed

+78
-78
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Wrapper over [validator.js][1] library that provides you easy way to use it with
1818
Create your class and put some validation annotations on its properties you want to validate:
1919

2020
```typescript
21-
import {Contains, IsInt, IsLength, IsEmail, IsFQDN, IsDate} from "validator.ts/ValidationAnnotations";
21+
import {Contains, IsInt, IsLength, IsEmail, IsFQDN, IsDate} from "validator.ts/decorator/ValidationDecorators";
2222

2323
export class Post {
2424

‎gulpfile.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Gulpclass, Task, SequenceTask} from "gulpfile.ts/Annotations";
1+
import {Gulpclass, Task, SequenceTask} from "gulpclass/Decorators";
22
import * as gulp from "gulp";
33

44
const del: any = require('del');

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"gulp": "^3.9.0",
3939
"gulp-replace": "^0.5.4",
4040
"gulp-shell": "^0.5.0",
41-
"gulpfile.ts": "0.0.2",
41+
"gulpclass": "0.0.4",
4242
"tsd": "^0.6.4",
4343
"typescript": "^1.6.2"
4444
},

‎sample/sample1-simple-validation/Post.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Contains, IsInt, MinLength, MaxLength, IsEmail, IsFQDN, IsDate, NotEmpty, NotEmptyArray, MinElements, MaxElements} from "../../src/annotation/ValidationAnnotations";
1+
import {Contains, IsInt, MinLength, MaxLength, IsEmail, IsFQDN, IsDate, NotEmpty, NotEmptyArray, MinElements, MaxElements} from "../../src/decorator/ValidationDecorators";
22

33
export class Post {
44

‎sample/sample2-simple-sanitization/Post.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Trim, Rtrim, ToInt, Blacklist} from "../../src/annotation/SanitizeAnnotations";
1+
import {Trim, Rtrim, ToInt, Blacklist} from "../../src/decorator/SanitizeDecorators";
22

33
export class Post {
44

‎sample/sample3-using-groups/Post.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Contains, IsInt, IsLength, IsEmail, IsFQDN, IsDate} from "../../src/annotation/ValidationAnnotations";
1+
import {Contains, IsInt, IsLength, IsEmail, IsFQDN, IsDate} from "../../src/decorator/ValidationDecorators";
22

33
export class Post {
44

‎sample/sample4-nested-objects/Post.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Contains, IsInt, IsLength, IsEmail, IsFQDN, IsDate, ValidateNested} from "../../src/annotation/ValidationAnnotations";
1+
import {Contains, IsInt, IsLength, IsEmail, IsFQDN, IsDate, ValidateNested} from "../../src/decorator/ValidationDecorators";
22
import {Tag} from "./Tag";
33

44
export class Post {

‎sample/sample4-nested-objects/Tag.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Contains, IsInt, IsLength, IsEmail, IsFQDN, IsDate} from "../../src/annotation/ValidationAnnotations";
1+
import {Contains, IsInt, IsLength, IsEmail, IsFQDN, IsDate} from "../../src/decorator/ValidationDecorators";
22

33
export class Tag {
44

‎src/annotation/SanitizeAnnotations.ts ‎src/decorator/SanitizeDecorators.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {defaultMetadataStorage} from "../metadata/MetadataStorage";
22
import {SanitizeTypes} from "../types/SanitizeTypes";
3-
import {ValidationAnnotationOptions} from "./options/ValidationAnnotationOptions";
3+
import {ValidationDecoratorOptions} from "./options/ValidationDecoratorOptions";
44

55
/**
66
* Remove characters that appear in the blacklist. The characters are used in a RegExp and so you will need to
77
* escape some chars, e.g @Blacklist('\\[\\]')
88
*/
9-
export function Blacklist(chars: RegExp, annotationOptions?: ValidationAnnotationOptions) {
9+
export function Blacklist(chars: RegExp, annotationOptions?: ValidationDecoratorOptions) {
1010
return function (object: Object, propertyName: string) {
1111
defaultMetadataStorage.addValidationMetadata({
1212
sanitize: true,
@@ -22,7 +22,7 @@ export function Blacklist(chars: RegExp, annotationOptions?: ValidationAnnotatio
2222
/**
2323
* Replace <, >, &, ', " and / with HTML entities.
2424
*/
25-
export function Escape(annotationOptions?: ValidationAnnotationOptions) {
25+
export function Escape(annotationOptions?: ValidationDecoratorOptions) {
2626
return function (object: Object, propertyName: string) {
2727
defaultMetadataStorage.addValidationMetadata({
2828
sanitize: true,
@@ -37,7 +37,7 @@ export function Escape(annotationOptions?: ValidationAnnotationOptions) {
3737
/**
3838
* Trim characters from the left-side of the input.
3939
*/
40-
export function Ltrim(chars?: string[], annotationOptions?: ValidationAnnotationOptions) {
40+
export function Ltrim(chars?: string[], annotationOptions?: ValidationDecoratorOptions) {
4141
return function (object: Object, propertyName: string) {
4242
defaultMetadataStorage.addValidationMetadata({
4343
sanitize: true,
@@ -53,7 +53,7 @@ export function Ltrim(chars?: string[], annotationOptions?: ValidationAnnotation
5353
/**
5454
* Canonicalize an email address.
5555
*/
56-
export function NormalizeEmail(lowercase?: boolean, annotationOptions?: ValidationAnnotationOptions) {
56+
export function NormalizeEmail(lowercase?: boolean, annotationOptions?: ValidationDecoratorOptions) {
5757
return function (object: Object, propertyName: string) {
5858
defaultMetadataStorage.addValidationMetadata({
5959
sanitize: true,
@@ -69,7 +69,7 @@ export function NormalizeEmail(lowercase?: boolean, annotationOptions?: Validati
6969
/**
7070
* Trim characters from the left-side of the input.
7171
*/
72-
export function Rtrim(chars?: string[], annotationOptions?: ValidationAnnotationOptions) {
72+
export function Rtrim(chars?: string[], annotationOptions?: ValidationDecoratorOptions) {
7373
return function (object: Object, propertyName: string) {
7474
defaultMetadataStorage.addValidationMetadata({
7575
sanitize: true,
@@ -87,7 +87,7 @@ export function Rtrim(chars?: string[], annotationOptions?: ValidationAnnotation
8787
* If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD).
8888
* Unicode-safe in JavaScript.
8989
*/
90-
export function StripLow(keepNewLines?: boolean, annotationOptions?: ValidationAnnotationOptions) {
90+
export function StripLow(keepNewLines?: boolean, annotationOptions?: ValidationDecoratorOptions) {
9191
return function (object: Object, propertyName: string) {
9292
defaultMetadataStorage.addValidationMetadata({
9393
sanitize: true,
@@ -104,7 +104,7 @@ export function StripLow(keepNewLines?: boolean, annotationOptions?: ValidationA
104104
* Convert the input to a boolean.
105105
* Everything except for '0', 'false' and '' returns true. In strict mode only '1' and 'true' return true.
106106
*/
107-
export function ToBoolean(isStrict?: boolean, annotationOptions?: ValidationAnnotationOptions) {
107+
export function ToBoolean(isStrict?: boolean, annotationOptions?: ValidationDecoratorOptions) {
108108
return function (object: Object, propertyName: string) {
109109
defaultMetadataStorage.addValidationMetadata({
110110
sanitize: true,
@@ -120,7 +120,7 @@ export function ToBoolean(isStrict?: boolean, annotationOptions?: ValidationAnno
120120
/**
121121
* Convert the input to a date, or null if the input is not a date.
122122
*/
123-
export function ToDate(annotationOptions?: ValidationAnnotationOptions) {
123+
export function ToDate(annotationOptions?: ValidationDecoratorOptions) {
124124
return function (object: Object, propertyName: string) {
125125
defaultMetadataStorage.addValidationMetadata({
126126
sanitize: true,
@@ -135,7 +135,7 @@ export function ToDate(annotationOptions?: ValidationAnnotationOptions) {
135135
/**
136136
* Convert the input to a float.
137137
*/
138-
export function ToFloat(annotationOptions?: ValidationAnnotationOptions) {
138+
export function ToFloat(annotationOptions?: ValidationDecoratorOptions) {
139139
return function (object: Object, propertyName: string) {
140140
defaultMetadataStorage.addValidationMetadata({
141141
sanitize: true,
@@ -150,7 +150,7 @@ export function ToFloat(annotationOptions?: ValidationAnnotationOptions) {
150150
/**
151151
* Convert the input to an integer, or NaN if the input is not an integer.
152152
*/
153-
export function ToInt(radix?: number, annotationOptions?: ValidationAnnotationOptions) {
153+
export function ToInt(radix?: number, annotationOptions?: ValidationDecoratorOptions) {
154154
return function (object: Object, propertyName: string) {
155155
defaultMetadataStorage.addValidationMetadata({
156156
sanitize: true,
@@ -166,7 +166,7 @@ export function ToInt(radix?: number, annotationOptions?: ValidationAnnotationOp
166166
/**
167167
* Convert the input to a string.
168168
*/
169-
export function ToString(annotationOptions?: ValidationAnnotationOptions) {
169+
export function ToString(annotationOptions?: ValidationDecoratorOptions) {
170170
return function (object: Object, propertyName: string) {
171171
defaultMetadataStorage.addValidationMetadata({
172172
sanitize: true,
@@ -181,7 +181,7 @@ export function ToString(annotationOptions?: ValidationAnnotationOptions) {
181181
/**
182182
* Trim characters (whitespace by default) from both sides of the input. You can specify chars that should be trimmed.
183183
*/
184-
export function Trim(chars?: string[], annotationOptions?: ValidationAnnotationOptions) {
184+
export function Trim(chars?: string[], annotationOptions?: ValidationDecoratorOptions) {
185185
return function (object: Object, propertyName: string) {
186186
defaultMetadataStorage.addValidationMetadata({
187187
sanitize: true,
@@ -198,7 +198,7 @@ export function Trim(chars?: string[], annotationOptions?: ValidationAnnotationO
198198
* Remove characters that do not appear in the whitelist.
199199
* The characters are used in a RegExp and so you will need to escape some chars, e.g. whitelist(input, '\\[\\]').
200200
*/
201-
export function Whitelist(chars: RegExp, annotationOptions?: ValidationAnnotationOptions) {
201+
export function Whitelist(chars: RegExp, annotationOptions?: ValidationDecoratorOptions) {
202202
return function (object: Object, propertyName: string) {
203203
defaultMetadataStorage.addValidationMetadata({
204204
sanitize: true,

0 commit comments

Comments
 (0)