diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-21 14:55:10 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 0c9668f77901e7540e2c7045eb0f2974a4842a69 (patch) | |
tree | 226d3dd1565b0bb56588897af3b8530e6216e96b /shared/core-utils/common/number.ts | |
parent | 6bcb854cdea8688a32240bc5719c7d139806e00b (diff) | |
download | PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.gz PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.zst PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.zip |
Implement remote runner jobs in server
Move ffmpeg functions to @shared
Diffstat (limited to 'shared/core-utils/common/number.ts')
-rw-r--r-- | shared/core-utils/common/number.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/shared/core-utils/common/number.ts b/shared/core-utils/common/number.ts index 9a96dcf5c..ce5a6041a 100644 --- a/shared/core-utils/common/number.ts +++ b/shared/core-utils/common/number.ts | |||
@@ -1,7 +1,13 @@ | |||
1 | function forceNumber (value: any) { | 1 | export function forceNumber (value: any) { |
2 | return parseInt(value + '') | 2 | return parseInt(value + '') |
3 | } | 3 | } |
4 | 4 | ||
5 | export { | 5 | export function isOdd (num: number) { |
6 | forceNumber | 6 | return (num % 2) !== 0 |
7 | } | ||
8 | |||
9 | export function toEven (num: number) { | ||
10 | if (isOdd(num)) return num + 1 | ||
11 | |||
12 | return num | ||
7 | } | 13 | } |