mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
chore: sentry and nextjs major bumps (#633)
* 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>
This commit is contained in:
12
www/app/lib/array.ts
Normal file
12
www/app/lib/array.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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");
|
||||
};
|
||||
Reference in New Issue
Block a user