refactor: jwt internal version migration

This commit is contained in:
DarkSky
2022-08-23 17:07:16 +08:00
parent eedb4864df
commit 6df2676c88
18 changed files with 274 additions and 145 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ class BlockScopedEventBus<T> extends BlockEventBus {
options?: ListenerOptions
) {
if (options?.debounce) {
const { wait, maxWait } = options.debounce;
const { wait, maxWait = 500 } = options.debounce;
const debounced = debounce(listener, wait, { maxWait });
this.on_listener(this._topic, name, e => {
debounced((e as CustomEvent)?.detail);
+3 -1
View File
@@ -39,7 +39,9 @@ export function getLogger(namespace: string) {
if (JWT_DEV) {
const logger = debug(namespace);
logger.log = console.log.bind(console);
if (JWT_DEV === ('testing' as any)) logger.enabled = true;
if (JWT_DEV === ('testing' as any)) {
logger.enabled = true;
}
return logger;
} else {
return () => {};