aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils/common/number.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-04-21 14:55:10 +0200
committerChocobozzz <chocobozzz@cpy.re>2023-05-09 08:57:34 +0200
commit0c9668f77901e7540e2c7045eb0f2974a4842a69 (patch)
tree226d3dd1565b0bb56588897af3b8530e6216e96b /shared/core-utils/common/number.ts
parent6bcb854cdea8688a32240bc5719c7d139806e00b (diff)
downloadPeerTube-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.ts12
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 @@
1function forceNumber (value: any) { 1export function forceNumber (value: any) {
2 return parseInt(value + '') 2 return parseInt(value + '')
3} 3}
4 4
5export { 5export function isOdd (num: number) {
6 forceNumber 6 return (num % 2) !== 0
7}
8
9export function toEven (num: number) {
10 if (isOdd(num)) return num + 1
11
12 return num
7} 13}