Commit 000f9cb3 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Migrate warn-once to TS

parent 11b0e004
/** @type {Set<string>} */
let shownWarnings = new Set();
const shownWarnings = new Set<string>();
/**
* Log a warning if it has not already been reported.
......@@ -7,12 +6,12 @@ let shownWarnings = new Set();
* This is useful to avoid spamming the console if a warning is emitted in a
* context that may be called frequently.
*
* @param {...unknown} args -
* @param args -
* Arguments to forward to `console.warn`. The arguments `toString()` values
* are concatenated into a string key which is used to determine if the warning
* has been logged before.
*/
export function warnOnce(...args) {
export function warnOnce(...args: unknown[]) {
const key = args.join();
if (shownWarnings.has(key)) {
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment