@gjsify/eventsource 0.4.28 → 0.4.29

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.
Files changed (2) hide show
  1. package/globals.mjs +16 -16
  2. package/package.json +5 -5
package/globals.mjs CHANGED
@@ -8,20 +8,20 @@ export const EventSource = globalThis.EventSource;
8
8
  // TextLineStream is not a Web standard — it's a utility class from @gjsify/eventsource.
9
9
  // Re-implement minimally for Node.js test compatibility.
10
10
  export class TextLineStream extends TransformStream {
11
- constructor() {
12
- let buffer = '';
13
- super({
14
- transform(chunk, controller) {
15
- buffer += chunk;
16
- const lines = buffer.split('\n');
17
- buffer = lines.pop() || '';
18
- for (const line of lines) {
19
- controller.enqueue(line.endsWith('\r') ? line.slice(0, -1) : line);
20
- }
21
- },
22
- flush(controller) {
23
- if (buffer) controller.enqueue(buffer);
24
- }
25
- });
26
- }
11
+ constructor() {
12
+ let buffer = '';
13
+ super({
14
+ transform(chunk, controller) {
15
+ buffer += chunk;
16
+ const lines = buffer.split('\n');
17
+ buffer = lines.pop() || '';
18
+ for (const line of lines) {
19
+ controller.enqueue(line.endsWith('\r') ? line.slice(0, -1) : line);
20
+ }
21
+ },
22
+ flush(controller) {
23
+ if (buffer) controller.enqueue(buffer);
24
+ },
25
+ });
26
+ }
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/eventsource",
3
- "version": "0.4.28",
3
+ "version": "0.4.29",
4
4
  "description": "W3C EventSource (Server-Sent Events) for GJS",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -43,12 +43,12 @@
43
43
  "server-sent-events"
44
44
  ],
45
45
  "dependencies": {
46
- "@gjsify/dom-events": "^0.4.28",
47
- "@gjsify/web-streams": "^0.4.28"
46
+ "@gjsify/dom-events": "^0.4.29",
47
+ "@gjsify/web-streams": "^0.4.29"
48
48
  },
49
49
  "devDependencies": {
50
- "@gjsify/cli": "^0.4.28",
51
- "@gjsify/unit": "^0.4.28",
50
+ "@gjsify/cli": "^0.4.29",
51
+ "@gjsify/unit": "^0.4.29",
52
52
  "@types/node": "^25.9.1",
53
53
  "typescript": "^6.0.3"
54
54
  }