htmx-router 1.0.13 → 1.0.14

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.
package/event-source.js CHANGED
@@ -71,8 +71,10 @@ export class EventSource {
71
71
  return this.sendText("\n\n", false);
72
72
  }
73
73
  dispatch(type, data) {
74
- if (this.#state !== EventSource.CLOSED)
75
- console.warn(`Warn: Attempted to dispatch event "${type}" to a closed connection for: ${this.url}`);
74
+ if (this.#state === EventSource.CLOSED) {
75
+ const err = new Error(`Warn: Attempted to dispatch event "${type}" to a closed connection for: ${this.url}`, {});
76
+ console.warn(err);
77
+ }
76
78
  return this.sendText(`event: ${type}\ndata: ${data}\n\n`, true);
77
79
  }
78
80
  close(unlink = true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htmx-router",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "A lightweight SSR framework with server+client islands",
5
5
  "keywords": [
6
6
  "htmx",
package/status.d.ts CHANGED
@@ -64,7 +64,11 @@ declare const dictionary: {
64
64
  511: "Network Authentication Required";
65
65
  };
66
66
  type Definitions = typeof dictionary;
67
- export type Status = keyof Definitions;
68
- export type StatusText = Definitions[Status];
69
- export declare function MakeStatus(lookup: Status | StatusText, init?: ResponseInit | Headers): ResponseInit;
67
+ export type StatusCode = keyof Definitions;
68
+ export type StatusText = Definitions[StatusCode];
69
+ export declare function MakeStatus(lookup: StatusCode | StatusText, init?: ResponseInit | Headers): ResponseInit;
70
+ /**
71
+ * @deprecated
72
+ */
73
+ export type Status = StatusCode;
70
74
  export {};