@vielzeug/herald 2.0.0 → 2.2.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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"devtools.js","names":[],"sources":["../src/devtools.ts"],"sourcesContent":["/**\n * @vielzeug/herald — debug utilities for bus visualisation.\n *\n * Import from the dedicated sub-path so it is tree-shaken from production bundles:\n * ```ts\n * import { debugBus } from '@vielzeug/herald/devtools';\n * ```\n */\n\nimport type { Bus, BusLogger, BusOptions, EventMap } from './types';\n\nimport { createBus } from './bus';\n\n/**\n * Creates a {@link Bus} with debug logging pre-wired to `console.debug`.\n *\n * Equivalent to `createBus({ logger: { debug: console.debug } })` but imported\n * from a dedicated sub-path so `console.debug` references are tree-shaken from\n * production bundles when this sub-path is not imported.\n *\n * Logs subscription registrations/removals, emissions, and disposal with\n * `[herald:*]` prefixes. Pass `logger.warn` to also redirect or silence warnings.\n *\n * @example\n * ```ts\n * import { debugBus } from '@vielzeug/herald/devtools';\n *\n * const bus = debugBus<MyEvents>();\n * // or redirect to a custom logger:\n * const bus = debugBus<MyEvents>({ logger: { warn: myLogger.warn } });\n * ```\n */\nexport function debugBus<T extends EventMap>(\n options?: Omit<BusOptions<T>, 'logger'> & { logger?: { warn?: BusLogger['warn'] } },\n): Bus<T> {\n const { logger, ...rest } = options ?? {};\n\n return createBus<T>({\n ...rest,\n logger: { debug: console.debug, warn: logger?.warn },\n });\n}\n"],"mappings":";;AAgCA,SAAgB,EACd,GACQ;CACR,IAAM,EAAE,WAAQ,GAAG,MAAS,KAAW,CAAC;CAExC,OAAO,EAAa;EAClB,GAAG;EACH,QAAQ;GAAE,OAAO,QAAQ;GAAO,MAAM,GAAQ;EAAK;CACrD,CAAC;AACH"}