mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
* chore: remove nextjs-config * build fix * sentry update * nextjs update * feature flags doc * update readme * explicit nextjs env vars + remove feature-unrelated things and obsolete vars from config * full config removal * remove force-dynamic from pages * compile fix * restore claude-deleted tests * no sentry backward compat * better .env.example * AUTHENTIK_REFRESH_TOKEN_URL not so required * accommodate auth system to requiredLogin feature --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
13 lines
335 B
TypeScript
13 lines
335 B
TypeScript
export type NonEmptyArray<T> = [T, ...T[]];
|
|
export const isNonEmptyArray = <T>(arr: T[]): arr is NonEmptyArray<T> =>
|
|
arr.length > 0;
|
|
export const assertNonEmptyArray = <T>(
|
|
arr: T[],
|
|
err?: string,
|
|
): NonEmptyArray<T> => {
|
|
if (isNonEmptyArray(arr)) {
|
|
return arr;
|
|
}
|
|
throw new Error(err ?? "Expected non-empty array");
|
|
};
|