mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
fix: token refresh locking (#613)
* fix: kv use tls explicit * fix: token refresh locking * remove logs * compile fix * compile fix --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
This commit is contained in:
@@ -158,6 +158,17 @@ export const assertExists = <T>(
|
||||
return value;
|
||||
};
|
||||
|
||||
export const assertNotExists = <T>(
|
||||
value: T | null | undefined,
|
||||
err?: string,
|
||||
): void => {
|
||||
if (value !== null && value !== undefined) {
|
||||
throw new Error(
|
||||
`Assertion failed: ${err ?? "value is not null or undefined"}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export const assertExistsAndNonEmptyString = (
|
||||
value: string | null | undefined,
|
||||
): NonEmptyString =>
|
||||
|
||||
Reference in New Issue
Block a user