1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add video chapters support

This commit is contained in:
Chocobozzz 2023-08-28 10:55:04 +02:00
parent 7113f32a87
commit 77b70702d2
No known key found for this signature in database
GPG key ID: 583A612D890159BE
101 changed files with 1957 additions and 158 deletions

View file

@ -7,17 +7,6 @@ function removeElementFromArray <T> (arr: T[], elem: T) {
if (index !== -1) arr.splice(index, 1)
}
function sortBy (obj: any[], key1: string, key2?: string) {
return obj.sort((a, b) => {
const elem1 = key2 ? a[key1][key2] : a[key1]
const elem2 = key2 ? b[key1][key2] : b[key1]
if (elem1 < elem2) return -1
if (elem1 === elem2) return 0
return 1
})
}
function splitIntoArray (value: any) {
if (!value) return undefined
if (Array.isArray(value)) return value
@ -41,7 +30,6 @@ function toBoolean (value: any) {
}
export {
sortBy,
immutableAssign,
removeElementFromArray,
splitIntoArray,