9
9
import Parser from 'core/json/stream/parser' ;
10
10
11
11
import { Pick } from 'core/json/stream/filters' ;
12
- import { ArrayStreamer , ObjectStreamer } from 'core/json/stream/streamers' ;
12
+ import { ArrayStreamer , ObjectStreamer , StreamedArray , StreamedObject } from 'core/json/stream/streamers' ;
13
13
14
14
describe ( 'core/json/stream/streamers' , ( ) => {
15
15
describe ( '`ArrayStreamer`' , ( ) => {
@@ -23,7 +23,7 @@ describe('core/json/stream/streamers', () => {
23
23
}` ;
24
24
25
25
const
26
- tokens = [ ] ;
26
+ tokens : StreamedArray [ ] = [ ] ;
27
27
28
28
for await ( const token of Parser . from ( [ data ] , new Pick ( 'a.b' ) , new ArrayStreamer ( ) ) ) {
29
29
tokens . push ( token ) ;
@@ -39,7 +39,7 @@ describe('core/json/stream/streamers', () => {
39
39
40
40
it ( 'should stream nothing if the source array is empty' , async ( ) => {
41
41
const
42
- tokens = [ ] ;
42
+ tokens : StreamedArray [ ] = [ ] ;
43
43
44
44
for await ( const token of Parser . from ( [ '[]' ] , new ArrayStreamer ( ) ) ) {
45
45
tokens . push ( token ) ;
@@ -53,7 +53,7 @@ describe('core/json/stream/streamers', () => {
53
53
err ;
54
54
55
55
const
56
- tokens = [ ] ;
56
+ tokens : StreamedArray [ ] = [ ] ;
57
57
58
58
try {
59
59
for await ( const token of Parser . from ( [ '{"a": 1}' ] , new ArrayStreamer ( ) ) ) {
@@ -80,7 +80,7 @@ describe('core/json/stream/streamers', () => {
80
80
}` ;
81
81
82
82
const
83
- tokens = [ ] ;
83
+ tokens : StreamedObject [ ] = [ ] ;
84
84
85
85
for await ( const token of Parser . from ( [ data ] , new ObjectStreamer ( ) ) ) {
86
86
tokens . push ( token ) ;
@@ -94,7 +94,7 @@ describe('core/json/stream/streamers', () => {
94
94
95
95
it ( 'should stream nothing if the source object is empty' , async ( ) => {
96
96
const
97
- tokens = [ ] ;
97
+ tokens : StreamedObject [ ] = [ ] ;
98
98
99
99
for await ( const token of Parser . from ( [ '{}' ] , new ObjectStreamer ( ) ) ) {
100
100
tokens . push ( token ) ;
@@ -108,7 +108,7 @@ describe('core/json/stream/streamers', () => {
108
108
err ;
109
109
110
110
const
111
- tokens = [ ] ;
111
+ tokens : StreamedObject [ ] = [ ] ;
112
112
113
113
try {
114
114
for await ( const token of Parser . from ( [ '[1,2]' ] , new ObjectStreamer ( ) ) ) {
0 commit comments