@supabase/ssr
Version:
Use the Supabase JavaScript library in popular server-side rendering (SSR) frameworks.
20 lines • 591 B
JavaScript
const warnedMessages = new Set();
/**
* Logs a warning to the console only once per process for each distinct
* message. Used for configuration warnings that would otherwise fire on
* every client creation (e.g. once per server request).
*/
export function warnOnce(message) {
if (warnedMessages.has(message)) {
return;
}
warnedMessages.add(message);
console.warn(message);
}
/**
* Clears the set of already-logged messages. Only for use in tests.
*/
export function resetWarnOnceForTesting() {
warnedMessages.clear();
}
//# sourceMappingURL=warnOnce.js.map