mirror of
https://github.com/goauthentik/authentik
synced 2026-05-08 16:13:02 +02:00
* web: a11y -- ak-sidebar * web: Fix paths, nesting. Allow for skipping. * web: a11y Modal button. * web: a11y -- alert, message * web: Add utils. * web: Fix types. * web: Tidy types. Fix alignment.
28 lines
657 B
JavaScript
28 lines
657 B
JavaScript
/**
|
|
* @file Helpers for running tests.
|
|
*/
|
|
|
|
/**
|
|
* A function that returns a promise.
|
|
* @template {never[]} [A=never[]]
|
|
* @typedef {(...args: A) => Promise<unknown>} Thenable
|
|
*/
|
|
|
|
/**
|
|
* A tuple of a function and its arguments.
|
|
* @template {Thenable} [T=Thenable]
|
|
* @typedef {[T, Parameters<T>]} SerializedThenable
|
|
*/
|
|
|
|
/**
|
|
* Executes a sequence of promise-returning functions in series
|
|
* @template {Thenable[]} T
|
|
* @param {{ [K in keyof T]: [T[K], ...Parameters<T[K]>] }} sequence
|
|
* @returns {Promise<void>}
|
|
*/
|
|
export async function series(...sequence) {
|
|
for (const [thenable, ...args] of sequence) {
|
|
await thenable(...args);
|
|
}
|
|
}
|