seroval 1.1.1 → 1.2.1

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 (55) hide show
  1. package/dist/cjs/development/index.cjs +728 -523
  2. package/dist/cjs/development/index.cjs.map +3 -3
  3. package/dist/cjs/production/index.cjs +7 -7
  4. package/dist/esm/development/index.mjs +728 -523
  5. package/dist/esm/development/index.mjs.map +3 -3
  6. package/dist/esm/production/index.mjs +7 -7
  7. package/dist/types/core/abort-signal.d.ts +2 -0
  8. package/dist/types/core/abort-signal.d.ts.map +1 -0
  9. package/dist/types/core/base-primitives.d.ts +2 -1
  10. package/dist/types/core/base-primitives.d.ts.map +1 -1
  11. package/dist/types/core/compat.d.ts +3 -2
  12. package/dist/types/core/compat.d.ts.map +1 -1
  13. package/dist/types/core/constants.d.ts +5 -1
  14. package/dist/types/core/constants.d.ts.map +1 -1
  15. package/dist/types/core/context/deserializer.d.ts +3 -0
  16. package/dist/types/core/context/deserializer.d.ts.map +1 -1
  17. package/dist/types/core/context/parser/async.d.ts +3 -0
  18. package/dist/types/core/context/parser/async.d.ts.map +1 -1
  19. package/dist/types/core/context/parser/stream.d.ts +3 -1
  20. package/dist/types/core/context/parser/stream.d.ts.map +1 -1
  21. package/dist/types/core/context/parser/sync.d.ts +4 -1
  22. package/dist/types/core/context/parser/sync.d.ts.map +1 -1
  23. package/dist/types/core/context/parser.d.ts +9 -10
  24. package/dist/types/core/context/parser.d.ts.map +1 -1
  25. package/dist/types/core/context/serializer.d.ts +4 -1
  26. package/dist/types/core/context/serializer.d.ts.map +1 -1
  27. package/dist/types/core/cross/index.d.ts.map +1 -1
  28. package/dist/types/core/literals.d.ts.map +1 -1
  29. package/dist/types/core/node.d.ts +8 -0
  30. package/dist/types/core/node.d.ts.map +1 -0
  31. package/dist/types/core/special-reference.d.ts +6 -1
  32. package/dist/types/core/special-reference.d.ts.map +1 -1
  33. package/dist/types/core/tree/serializer.d.ts +2 -1
  34. package/dist/types/core/tree/serializer.d.ts.map +1 -1
  35. package/dist/types/core/types.d.ts +20 -2
  36. package/dist/types/core/types.d.ts.map +1 -1
  37. package/dist/types/core/utils/iterator-to-sequence.d.ts.map +1 -1
  38. package/package.json +8 -8
  39. package/src/core/abort-signal.ts +19 -0
  40. package/src/core/base-primitives.ts +359 -337
  41. package/src/core/compat.ts +2 -1
  42. package/src/core/constants.ts +5 -0
  43. package/src/core/context/deserializer.ts +34 -1
  44. package/src/core/context/parser/async.ts +75 -22
  45. package/src/core/context/parser/stream.ts +91 -37
  46. package/src/core/context/parser/sync.ts +61 -7
  47. package/src/core/context/parser.ts +121 -117
  48. package/src/core/context/serializer.ts +55 -9
  49. package/src/core/cross/index.ts +2 -6
  50. package/src/core/literals.ts +16 -15
  51. package/src/core/node.ts +40 -0
  52. package/src/core/special-reference.ts +7 -0
  53. package/src/core/tree/serializer.ts +7 -0
  54. package/src/core/types.ts +32 -2
  55. package/src/core/utils/iterator-to-sequence.ts +3 -1
@@ -1,14 +1,16 @@
1
1
  import type { WellKnownSymbols } from './constants';
2
- import { INV_SYMBOL_REF, SerovalNodeType } from './constants';
2
+ import { INV_SYMBOL_REF, NIL, SerovalNodeType } from './constants';
3
3
  import {
4
4
  INFINITY_NODE,
5
5
  NAN_NODE,
6
6
  NEG_INFINITY_NODE,
7
7
  NEG_ZERO_NODE,
8
8
  } from './literals';
9
+ import { createSerovalNode } from './node';
9
10
  import { getReferenceID } from './reference';
10
11
  import { serializeString } from './string';
11
12
  import type {
13
+ SerovalAbortSignalSyncNode,
12
14
  SerovalAggregateErrorNode,
13
15
  SerovalArrayBufferNode,
14
16
  SerovalArrayNode,
@@ -60,108 +62,108 @@ export function createNumberNode(
60
62
  if (Object.is(value, -0)) {
61
63
  return NEG_ZERO_NODE;
62
64
  }
63
- return {
64
- t: SerovalNodeType.Number,
65
- i: undefined,
66
- s: value,
67
- l: undefined,
68
- c: undefined,
69
- m: undefined,
70
- p: undefined,
71
- e: undefined,
72
- a: undefined,
73
- f: undefined,
74
- b: undefined,
75
- o: undefined,
76
- };
65
+ return createSerovalNode(
66
+ SerovalNodeType.Number,
67
+ NIL,
68
+ value,
69
+ NIL,
70
+ NIL,
71
+ NIL,
72
+ NIL,
73
+ NIL,
74
+ NIL,
75
+ NIL,
76
+ NIL,
77
+ NIL,
78
+ );
77
79
  }
78
80
 
79
81
  export function createStringNode(value: string): SerovalStringNode {
80
- return {
81
- t: SerovalNodeType.String,
82
- i: undefined,
83
- s: serializeString(value),
84
- l: undefined,
85
- c: undefined,
86
- m: undefined,
87
- p: undefined,
88
- e: undefined,
89
- a: undefined,
90
- f: undefined,
91
- b: undefined,
92
- o: undefined,
93
- };
82
+ return createSerovalNode(
83
+ SerovalNodeType.String,
84
+ NIL,
85
+ serializeString(value),
86
+ NIL,
87
+ NIL,
88
+ NIL,
89
+ NIL,
90
+ NIL,
91
+ NIL,
92
+ NIL,
93
+ NIL,
94
+ NIL,
95
+ );
94
96
  }
95
97
 
96
98
  export function createBigIntNode(current: bigint): SerovalBigIntNode {
97
- return {
98
- t: SerovalNodeType.BigInt,
99
- i: undefined,
100
- s: '' + current,
101
- l: undefined,
102
- c: undefined,
103
- m: undefined,
104
- p: undefined,
105
- e: undefined,
106
- a: undefined,
107
- f: undefined,
108
- b: undefined,
109
- o: undefined,
110
- };
99
+ return createSerovalNode(
100
+ SerovalNodeType.BigInt,
101
+ NIL,
102
+ '' + current,
103
+ NIL,
104
+ NIL,
105
+ NIL,
106
+ NIL,
107
+ NIL,
108
+ NIL,
109
+ NIL,
110
+ NIL,
111
+ NIL,
112
+ );
111
113
  }
112
114
 
113
115
  export function createIndexedValueNode(id: number): SerovalIndexedValueNode {
114
- return {
115
- t: SerovalNodeType.IndexedValue,
116
- i: id,
117
- s: undefined,
118
- l: undefined,
119
- c: undefined,
120
- m: undefined,
121
- p: undefined,
122
- e: undefined,
123
- a: undefined,
124
- f: undefined,
125
- b: undefined,
126
- o: undefined,
127
- };
116
+ return createSerovalNode(
117
+ SerovalNodeType.IndexedValue,
118
+ id,
119
+ NIL,
120
+ NIL,
121
+ NIL,
122
+ NIL,
123
+ NIL,
124
+ NIL,
125
+ NIL,
126
+ NIL,
127
+ NIL,
128
+ NIL,
129
+ );
128
130
  }
129
131
 
130
132
  export function createDateNode(id: number, current: Date): SerovalDateNode {
131
- return {
132
- t: SerovalNodeType.Date,
133
- i: id,
134
- s: current.toISOString(),
135
- l: undefined,
136
- c: undefined,
137
- m: undefined,
138
- p: undefined,
139
- e: undefined,
140
- f: undefined,
141
- a: undefined,
142
- b: undefined,
143
- o: undefined,
144
- };
133
+ return createSerovalNode(
134
+ SerovalNodeType.Date,
135
+ id,
136
+ current.toISOString(),
137
+ NIL,
138
+ NIL,
139
+ NIL,
140
+ NIL,
141
+ NIL,
142
+ NIL,
143
+ NIL,
144
+ NIL,
145
+ NIL,
146
+ );
145
147
  }
146
148
 
147
149
  export function createRegExpNode(
148
150
  id: number,
149
151
  current: RegExp,
150
152
  ): SerovalRegExpNode {
151
- return {
152
- t: SerovalNodeType.RegExp,
153
- i: id,
154
- s: undefined,
155
- l: undefined,
156
- c: serializeString(current.source),
157
- m: current.flags,
158
- p: undefined,
159
- e: undefined,
160
- a: undefined,
161
- f: undefined,
162
- b: undefined,
163
- o: undefined,
164
- };
153
+ return createSerovalNode(
154
+ SerovalNodeType.RegExp,
155
+ id,
156
+ NIL,
157
+ NIL,
158
+ serializeString(current.source),
159
+ current.flags,
160
+ NIL,
161
+ NIL,
162
+ NIL,
163
+ NIL,
164
+ NIL,
165
+ NIL,
166
+ );
165
167
  }
166
168
 
167
169
  export function createArrayBufferNode(
@@ -174,60 +176,60 @@ export function createArrayBufferNode(
174
176
  for (let i = 0; i < len; i++) {
175
177
  values[i] = bytes[i];
176
178
  }
177
- return {
178
- t: SerovalNodeType.ArrayBuffer,
179
- i: id,
180
- s: values,
181
- l: undefined,
182
- c: undefined,
183
- m: undefined,
184
- p: undefined,
185
- e: undefined,
186
- a: undefined,
187
- f: undefined,
188
- b: undefined,
189
- o: undefined,
190
- };
179
+ return createSerovalNode(
180
+ SerovalNodeType.ArrayBuffer,
181
+ id,
182
+ values,
183
+ NIL,
184
+ NIL,
185
+ NIL,
186
+ NIL,
187
+ NIL,
188
+ NIL,
189
+ NIL,
190
+ NIL,
191
+ NIL,
192
+ );
191
193
  }
192
194
 
193
195
  export function createWKSymbolNode(
194
196
  id: number,
195
197
  current: WellKnownSymbols,
196
198
  ): SerovalWKSymbolNode {
197
- return {
198
- t: SerovalNodeType.WKSymbol,
199
- i: id,
200
- s: INV_SYMBOL_REF[current],
201
- l: undefined,
202
- c: undefined,
203
- m: undefined,
204
- p: undefined,
205
- e: undefined,
206
- a: undefined,
207
- f: undefined,
208
- b: undefined,
209
- o: undefined,
210
- };
199
+ return createSerovalNode(
200
+ SerovalNodeType.WKSymbol,
201
+ id,
202
+ INV_SYMBOL_REF[current],
203
+ NIL,
204
+ NIL,
205
+ NIL,
206
+ NIL,
207
+ NIL,
208
+ NIL,
209
+ NIL,
210
+ NIL,
211
+ NIL,
212
+ );
211
213
  }
212
214
 
213
215
  export function createReferenceNode<T>(
214
216
  id: number,
215
217
  ref: T,
216
218
  ): SerovalReferenceNode {
217
- return {
218
- t: SerovalNodeType.Reference,
219
- i: id,
220
- s: serializeString(getReferenceID(ref)),
221
- l: undefined,
222
- c: undefined,
223
- m: undefined,
224
- p: undefined,
225
- e: undefined,
226
- a: undefined,
227
- f: undefined,
228
- b: undefined,
229
- o: undefined,
230
- };
219
+ return createSerovalNode(
220
+ SerovalNodeType.Reference,
221
+ id,
222
+ serializeString(getReferenceID(ref)),
223
+ NIL,
224
+ NIL,
225
+ NIL,
226
+ NIL,
227
+ NIL,
228
+ NIL,
229
+ NIL,
230
+ NIL,
231
+ NIL,
232
+ );
231
233
  }
232
234
 
233
235
  export function createPluginNode(
@@ -235,20 +237,20 @@ export function createPluginNode(
235
237
  tag: string,
236
238
  value: unknown,
237
239
  ): SerovalPluginNode {
238
- return {
239
- t: SerovalNodeType.Plugin,
240
- i: id,
241
- s: value,
242
- l: undefined,
243
- c: serializeString(tag),
244
- m: undefined,
245
- p: undefined,
246
- e: undefined,
247
- a: undefined,
248
- f: undefined,
249
- b: undefined,
250
- o: undefined,
251
- };
240
+ return createSerovalNode(
241
+ SerovalNodeType.Plugin,
242
+ id,
243
+ value,
244
+ NIL,
245
+ serializeString(tag),
246
+ NIL,
247
+ NIL,
248
+ NIL,
249
+ NIL,
250
+ NIL,
251
+ NIL,
252
+ NIL,
253
+ );
252
254
  }
253
255
 
254
256
  export function createArrayNode(
@@ -256,40 +258,40 @@ export function createArrayNode(
256
258
  current: unknown[],
257
259
  parsedItems: SerovalNode[],
258
260
  ): SerovalArrayNode {
259
- return {
260
- t: SerovalNodeType.Array,
261
- i: id,
262
- s: undefined,
263
- l: current.length,
264
- c: undefined,
265
- m: undefined,
266
- p: undefined,
267
- e: undefined,
268
- a: parsedItems,
269
- f: undefined,
270
- b: undefined,
271
- o: getObjectFlag(current),
272
- };
261
+ return createSerovalNode(
262
+ SerovalNodeType.Array,
263
+ id,
264
+ NIL,
265
+ current.length,
266
+ NIL,
267
+ NIL,
268
+ NIL,
269
+ NIL,
270
+ parsedItems,
271
+ NIL,
272
+ NIL,
273
+ getObjectFlag(current),
274
+ );
273
275
  }
274
276
 
275
277
  export function createBoxedNode(
276
278
  id: number,
277
279
  boxed: SerovalNode,
278
280
  ): SerovalBoxedNode {
279
- return {
280
- t: SerovalNodeType.Boxed,
281
- i: id,
282
- s: undefined,
283
- l: undefined,
284
- c: undefined,
285
- m: undefined,
286
- p: undefined,
287
- e: undefined,
288
- a: undefined,
289
- f: boxed,
290
- b: undefined,
291
- o: undefined,
292
- };
281
+ return createSerovalNode(
282
+ SerovalNodeType.Boxed,
283
+ id,
284
+ NIL,
285
+ NIL,
286
+ NIL,
287
+ NIL,
288
+ NIL,
289
+ NIL,
290
+ NIL,
291
+ boxed,
292
+ NIL,
293
+ NIL,
294
+ );
293
295
  }
294
296
 
295
297
  export function createTypedArrayNode(
@@ -297,20 +299,20 @@ export function createTypedArrayNode(
297
299
  current: TypedArrayValue,
298
300
  buffer: SerovalNode,
299
301
  ): SerovalTypedArrayNode {
300
- return {
301
- t: SerovalNodeType.TypedArray,
302
- i: id,
303
- s: undefined,
304
- l: current.length,
305
- c: current.constructor.name,
306
- m: undefined,
307
- p: undefined,
308
- e: undefined,
309
- a: undefined,
310
- f: buffer,
311
- b: current.byteOffset,
312
- o: undefined,
313
- };
302
+ return createSerovalNode(
303
+ SerovalNodeType.TypedArray,
304
+ id,
305
+ NIL,
306
+ current.length,
307
+ current.constructor.name,
308
+ NIL,
309
+ NIL,
310
+ NIL,
311
+ NIL,
312
+ buffer,
313
+ current.byteOffset,
314
+ NIL,
315
+ );
314
316
  }
315
317
 
316
318
  export function createBigIntTypedArrayNode(
@@ -318,20 +320,20 @@ export function createBigIntTypedArrayNode(
318
320
  current: BigIntTypedArrayValue,
319
321
  buffer: SerovalNode,
320
322
  ): SerovalBigIntTypedArrayNode {
321
- return {
322
- t: SerovalNodeType.BigIntTypedArray,
323
- i: id,
324
- s: undefined,
325
- l: current.length,
326
- c: current.constructor.name,
327
- m: undefined,
328
- p: undefined,
329
- e: undefined,
330
- a: undefined,
331
- f: buffer,
332
- b: current.byteOffset,
333
- o: undefined,
334
- };
323
+ return createSerovalNode(
324
+ SerovalNodeType.BigIntTypedArray,
325
+ id,
326
+ NIL,
327
+ current.length,
328
+ current.constructor.name,
329
+ NIL,
330
+ NIL,
331
+ NIL,
332
+ NIL,
333
+ buffer,
334
+ current.byteOffset,
335
+ NIL,
336
+ );
335
337
  }
336
338
 
337
339
  export function createDataViewNode(
@@ -339,20 +341,20 @@ export function createDataViewNode(
339
341
  current: DataView,
340
342
  buffer: SerovalNode,
341
343
  ): SerovalDataViewNode {
342
- return {
343
- t: SerovalNodeType.DataView,
344
- i: id,
345
- s: undefined,
346
- l: current.byteLength,
347
- c: undefined,
348
- m: undefined,
349
- p: undefined,
350
- e: undefined,
351
- a: undefined,
352
- f: buffer,
353
- b: current.byteOffset,
354
- o: undefined,
355
- };
344
+ return createSerovalNode(
345
+ SerovalNodeType.DataView,
346
+ id,
347
+ NIL,
348
+ current.byteLength,
349
+ NIL,
350
+ NIL,
351
+ NIL,
352
+ NIL,
353
+ NIL,
354
+ buffer,
355
+ current.byteOffset,
356
+ NIL,
357
+ );
356
358
  }
357
359
 
358
360
  export function createErrorNode(
@@ -360,20 +362,20 @@ export function createErrorNode(
360
362
  current: Error,
361
363
  options: SerovalObjectRecordNode | undefined,
362
364
  ): SerovalErrorNode {
363
- return {
364
- t: SerovalNodeType.Error,
365
- i: id,
366
- s: getErrorConstructor(current),
367
- l: undefined,
368
- c: undefined,
369
- m: serializeString(current.message),
370
- p: options,
371
- e: undefined,
372
- a: undefined,
373
- f: undefined,
374
- b: undefined,
375
- o: undefined,
376
- };
365
+ return createSerovalNode(
366
+ SerovalNodeType.Error,
367
+ id,
368
+ getErrorConstructor(current),
369
+ NIL,
370
+ NIL,
371
+ serializeString(current.message),
372
+ options,
373
+ NIL,
374
+ NIL,
375
+ NIL,
376
+ NIL,
377
+ NIL,
378
+ );
377
379
  }
378
380
 
379
381
  export function createAggregateErrorNode(
@@ -381,20 +383,20 @@ export function createAggregateErrorNode(
381
383
  current: AggregateError,
382
384
  options: SerovalObjectRecordNode | undefined,
383
385
  ): SerovalAggregateErrorNode {
384
- return {
385
- t: SerovalNodeType.AggregateError,
386
- i: id,
387
- s: getErrorConstructor(current),
388
- l: undefined,
389
- c: undefined,
390
- m: serializeString(current.message),
391
- p: options,
392
- e: undefined,
393
- a: undefined,
394
- f: undefined,
395
- b: undefined,
396
- o: undefined,
397
- };
386
+ return createSerovalNode(
387
+ SerovalNodeType.AggregateError,
388
+ id,
389
+ getErrorConstructor(current),
390
+ NIL,
391
+ NIL,
392
+ serializeString(current.message),
393
+ options,
394
+ NIL,
395
+ NIL,
396
+ NIL,
397
+ NIL,
398
+ NIL,
399
+ );
398
400
  }
399
401
 
400
402
  export function createSetNode(
@@ -402,60 +404,60 @@ export function createSetNode(
402
404
  size: number,
403
405
  items: SerovalNode[],
404
406
  ): SerovalSetNode {
405
- return {
406
- t: SerovalNodeType.Set,
407
- i: id,
408
- s: undefined,
409
- l: size,
410
- c: undefined,
411
- m: undefined,
412
- p: undefined,
413
- e: undefined,
414
- a: items,
415
- f: undefined,
416
- b: undefined,
417
- o: undefined,
418
- };
407
+ return createSerovalNode(
408
+ SerovalNodeType.Set,
409
+ id,
410
+ NIL,
411
+ size,
412
+ NIL,
413
+ NIL,
414
+ NIL,
415
+ NIL,
416
+ items,
417
+ NIL,
418
+ NIL,
419
+ NIL,
420
+ );
419
421
  }
420
422
 
421
423
  export function createIteratorFactoryInstanceNode(
422
424
  factory: SerovalNodeWithID,
423
425
  items: SerovalNode,
424
426
  ): SerovalIteratorFactoryInstanceNode {
425
- return {
426
- t: SerovalNodeType.IteratorFactoryInstance,
427
- i: undefined,
428
- s: undefined,
429
- l: undefined,
430
- c: undefined,
431
- m: undefined,
432
- p: undefined,
433
- e: undefined,
434
- a: [factory, items],
435
- f: undefined,
436
- b: undefined,
437
- o: undefined,
438
- };
427
+ return createSerovalNode(
428
+ SerovalNodeType.IteratorFactoryInstance,
429
+ NIL,
430
+ NIL,
431
+ NIL,
432
+ NIL,
433
+ NIL,
434
+ NIL,
435
+ NIL,
436
+ [factory, items],
437
+ NIL,
438
+ NIL,
439
+ NIL,
440
+ );
439
441
  }
440
442
 
441
443
  export function createAsyncIteratorFactoryInstanceNode(
442
444
  factory: SerovalNodeWithID,
443
445
  items: SerovalNode,
444
446
  ): SerovalAsyncIteratorFactoryInstanceNode {
445
- return {
446
- t: SerovalNodeType.AsyncIteratorFactoryInstance,
447
- i: undefined,
448
- s: undefined,
449
- l: undefined,
450
- c: undefined,
451
- m: undefined,
452
- p: undefined,
453
- e: undefined,
454
- a: [factory, items],
455
- f: undefined,
456
- b: undefined,
457
- o: undefined,
458
- };
447
+ return createSerovalNode(
448
+ SerovalNodeType.AsyncIteratorFactoryInstance,
449
+ NIL,
450
+ NIL,
451
+ NIL,
452
+ NIL,
453
+ NIL,
454
+ NIL,
455
+ NIL,
456
+ [factory, items],
457
+ NIL,
458
+ NIL,
459
+ NIL,
460
+ );
459
461
  }
460
462
 
461
463
  export function createStreamConstructorNode(
@@ -463,78 +465,98 @@ export function createStreamConstructorNode(
463
465
  factory: SerovalNodeWithID,
464
466
  sequence: SerovalNode[],
465
467
  ): SerovalStreamConstructorNode {
466
- return {
467
- t: SerovalNodeType.StreamConstructor,
468
- i: id,
469
- s: undefined,
470
- l: undefined,
471
- c: undefined,
472
- m: undefined,
473
- p: undefined,
474
- e: undefined,
475
- a: sequence,
476
- f: factory,
477
- b: undefined,
478
- o: undefined,
479
- };
468
+ return createSerovalNode(
469
+ SerovalNodeType.StreamConstructor,
470
+ id,
471
+ NIL,
472
+ NIL,
473
+ NIL,
474
+ NIL,
475
+ NIL,
476
+ NIL,
477
+ sequence,
478
+ factory,
479
+ NIL,
480
+ NIL,
481
+ );
480
482
  }
481
483
 
482
484
  export function createStreamNextNode(
483
485
  id: number,
484
486
  parsed: SerovalNode,
485
487
  ): SerovalStreamNextNode {
486
- return {
487
- t: SerovalNodeType.StreamNext,
488
- i: id,
489
- s: undefined,
490
- l: undefined,
491
- c: undefined,
492
- m: undefined,
493
- p: undefined,
494
- e: undefined,
495
- a: undefined,
496
- f: parsed,
497
- b: undefined,
498
- o: undefined,
499
- };
488
+ return createSerovalNode(
489
+ SerovalNodeType.StreamNext,
490
+ id,
491
+ NIL,
492
+ NIL,
493
+ NIL,
494
+ NIL,
495
+ NIL,
496
+ NIL,
497
+ NIL,
498
+ parsed,
499
+ NIL,
500
+ NIL,
501
+ );
500
502
  }
501
503
 
502
504
  export function createStreamThrowNode(
503
505
  id: number,
504
506
  parsed: SerovalNode,
505
507
  ): SerovalStreamThrowNode {
506
- return {
507
- t: SerovalNodeType.StreamThrow,
508
- i: id,
509
- s: undefined,
510
- l: undefined,
511
- c: undefined,
512
- m: undefined,
513
- p: undefined,
514
- e: undefined,
515
- a: undefined,
516
- f: parsed,
517
- b: undefined,
518
- o: undefined,
519
- };
508
+ return createSerovalNode(
509
+ SerovalNodeType.StreamThrow,
510
+ id,
511
+ NIL,
512
+ NIL,
513
+ NIL,
514
+ NIL,
515
+ NIL,
516
+ NIL,
517
+ NIL,
518
+ parsed,
519
+ NIL,
520
+ NIL,
521
+ );
520
522
  }
521
523
 
522
524
  export function createStreamReturnNode(
523
525
  id: number,
524
526
  parsed: SerovalNode,
525
527
  ): SerovalStreamReturnNode {
526
- return {
527
- t: SerovalNodeType.StreamReturn,
528
- i: id,
529
- s: undefined,
530
- l: undefined,
531
- c: undefined,
532
- m: undefined,
533
- p: undefined,
534
- e: undefined,
535
- a: undefined,
536
- f: parsed,
537
- b: undefined,
538
- o: undefined,
539
- };
528
+ return createSerovalNode(
529
+ SerovalNodeType.StreamReturn,
530
+ id,
531
+ NIL,
532
+ NIL,
533
+ NIL,
534
+ NIL,
535
+ NIL,
536
+ NIL,
537
+ NIL,
538
+ parsed,
539
+ NIL,
540
+ NIL,
541
+ );
542
+ }
543
+
544
+ export function createAbortSignalSyncNode(
545
+ id: number,
546
+ parsed: SerovalNode,
547
+ ): SerovalAbortSignalSyncNode {
548
+ return createSerovalNode(
549
+ SerovalNodeType.AbortSignalSync,
550
+ id,
551
+ NIL,
552
+ NIL,
553
+ NIL,
554
+ NIL,
555
+ NIL,
556
+ NIL,
557
+ NIL,
558
+ parsed,
559
+ NIL,
560
+ NIL,
561
+ );
540
562
  }