@qping/plugin-bus 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -426,21 +426,10 @@ async function runPlugin(handlers) {
426
426
  const identity = await completeHandshake(transport, token);
427
427
  const router = new HandlerRouter({ send: (env) => transport.send(env) });
428
428
  router.setIdentity(identity);
429
- const HOST_LOST_MS = 15e3;
430
- let lastPingAt = Date.now();
431
- const watchdog = setInterval(() => {
432
- if (Date.now() - lastPingAt > HOST_LOST_MS) {
433
- clearInterval(watchdog);
434
- process.exit(1);
435
- }
436
- }, 1e3);
437
- watchdog.unref?.();
438
429
  transport.onDisconnect(() => {
439
- clearInterval(watchdog);
440
430
  process.exit(1);
441
431
  });
442
432
  transport.onMessage((env) => {
443
- if (env.route === Routes.Bus.Ping) lastPingAt = Date.now();
444
433
  router.dispatch(env);
445
434
  });
446
435
  for (const [route, handler] of Object.entries(handlers)) {
@@ -450,7 +439,6 @@ async function runPlugin(handlers) {
450
439
  transport,
451
440
  router,
452
441
  close: async () => {
453
- clearInterval(watchdog);
454
442
  await transport.close();
455
443
  }
456
444
  };
package/dist/i18n.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // node_modules/i18next/dist/esm/i18next.js
1
+ // ../node_modules/i18next/dist/esm/i18next.js
2
2
  var isString = (obj) => typeof obj === "string";
3
3
  var defer = () => {
4
4
  let res;
package/dist/node.mjs CHANGED
@@ -435,21 +435,10 @@ async function runPlugin(handlers) {
435
435
  const identity = await completeHandshake(transport, token);
436
436
  const router = new HandlerRouter({ send: (env) => transport.send(env) });
437
437
  router.setIdentity(identity);
438
- const HOST_LOST_MS = 15e3;
439
- let lastPingAt = Date.now();
440
- const watchdog = setInterval(() => {
441
- if (Date.now() - lastPingAt > HOST_LOST_MS) {
442
- clearInterval(watchdog);
443
- process.exit(1);
444
- }
445
- }, 1e3);
446
- watchdog.unref?.();
447
438
  transport.onDisconnect(() => {
448
- clearInterval(watchdog);
449
439
  process.exit(1);
450
440
  });
451
441
  transport.onMessage((env) => {
452
- if (env.route === Routes.Bus.Ping) lastPingAt = Date.now();
453
442
  router.dispatch(env);
454
443
  });
455
444
  for (const [route, handler] of Object.entries(handlers)) {
@@ -459,7 +448,6 @@ async function runPlugin(handlers) {
459
448
  transport,
460
449
  router,
461
450
  close: async () => {
462
- clearInterval(watchdog);
463
451
  await transport.close();
464
452
  }
465
453
  };
package/dist/search.d.ts CHANGED
@@ -5,3 +5,6 @@
5
5
  * @example isSubsequence("gthb", "GitHub") // true
6
6
  */
7
7
  export declare function isSubsequence(pattern: string, target: string): boolean;
8
+ export declare function normalizeSearchText(text: string): string;
9
+ /** Compatible title recall: original text, multiword, pinyin and initials. */
10
+ export declare function matchesSearchText(query: string, title: string): boolean;