mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 20:21:20 -08:00
12 lines
252 B
TypeScript
12 lines
252 B
TypeScript
export function releaseAll(actions: (() => void)[]): void {
|
|
const failures: unknown[] = []
|
|
for (const action of actions) {
|
|
try {
|
|
action()
|
|
}
|
|
catch (error) { failures.push(error) }
|
|
}
|
|
if (failures.length)
|
|
throw failures[0]
|
|
}
|