diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-18 14:28:37 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | b4055e1c23eeefb0c8a85a77f312b2827d98f483 (patch) | |
tree | 51b6b04c1ad10897047817d2eaaa037d1331fa6a /shared/core-utils/miscs | |
parent | 66e001c848c009412c65cbce41be344d8985fd83 (diff) | |
download | PeerTube-b4055e1c23eeefb0c8a85a77f312b2827d98f483.tar.gz PeerTube-b4055e1c23eeefb0c8a85a77f312b2827d98f483.tar.zst PeerTube-b4055e1c23eeefb0c8a85a77f312b2827d98f483.zip |
Add server hooks
Diffstat (limited to 'shared/core-utils/miscs')
-rw-r--r-- | shared/core-utils/miscs/miscs.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/shared/core-utils/miscs/miscs.ts b/shared/core-utils/miscs/miscs.ts index a3921b568..5de024c08 100644 --- a/shared/core-utils/miscs/miscs.ts +++ b/shared/core-utils/miscs/miscs.ts | |||
@@ -19,7 +19,17 @@ function compareSemVer (a: string, b: string) { | |||
19 | return segmentsA.length - segmentsB.length | 19 | return segmentsA.length - segmentsB.length |
20 | } | 20 | } |
21 | 21 | ||
22 | function isPromise (value: any) { | ||
23 | return value && typeof value.then === 'function' | ||
24 | } | ||
25 | |||
26 | function isCatchable (value: any) { | ||
27 | return value && typeof value.catch === 'function' | ||
28 | } | ||
29 | |||
22 | export { | 30 | export { |
23 | randomInt, | 31 | randomInt, |
24 | compareSemVer | 32 | compareSemVer, |
33 | isPromise, | ||
34 | isCatchable | ||
25 | } | 35 | } |