diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
commit | 69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch) | |
tree | ad199a18ec3c322460d6f9523fc383ee562554e0 /server/helpers/custom-validators/misc.ts | |
parent | 4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff) | |
download | PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip |
Type functions
Diffstat (limited to 'server/helpers/custom-validators/misc.ts')
-rw-r--r-- | server/helpers/custom-validators/misc.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts index 83f50a7fe..b1291ba7a 100644 --- a/server/helpers/custom-validators/misc.ts +++ b/server/helpers/custom-validators/misc.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | function exists (value) { | 1 | function exists (value: any) { |
2 | return value !== undefined && value !== null | 2 | return value !== undefined && value !== null |
3 | } | 3 | } |
4 | 4 | ||
5 | function isArray (value) { | 5 | function isArray (value: any) { |
6 | return Array.isArray(value) | 6 | return Array.isArray(value) |
7 | } | 7 | } |
8 | 8 | ||
@@ -12,3 +12,12 @@ export { | |||
12 | exists, | 12 | exists, |
13 | isArray | 13 | isArray |
14 | } | 14 | } |
15 | |||
16 | declare global { | ||
17 | namespace ExpressValidator { | ||
18 | export interface Validator { | ||
19 | exists, | ||
20 | isArray | ||
21 | } | ||
22 | } | ||
23 | } | ||