1
0
mirror of https://github.com/snobu/destreamer.git synced 2026-01-26 18:02:19 +00:00

Preserve input URL array order

* Implement forEachAsync
* Preserve input URL array order

Co-authored-by: kylon <kylonux@gmail.com>
This commit is contained in:
kylon
2020-05-01 00:01:15 +02:00
committed by GitHub
parent 0f7f585deb
commit 516f6ce2cd
2 changed files with 8 additions and 3 deletions

View File

@@ -46,6 +46,10 @@ function readFileToArray(path: string) {
return fs.readFileSync(path).toString('utf-8').split(/[\r\n]/);
}
export async function forEachAsync(array: any, callback: any) {
for (let i=0, l=array.length; i<l; ++i)
await callback(array[i], i, array);
}
export function parseVideoUrls(videoUrls: any) {
let t = videoUrls[0] as string;