Skip to content

Commit 5474667

Browse files
committed
refactor: createAddStream
1 parent 312f8df commit 5474667

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lib/solr.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,13 @@ export class Client {
300300
method: 'POST',
301301
headers: headers,
302302
};
303-
const jsonStreamStringify = JSONStream.stringify();
304-
const postRequest = oldRequest(optionsRequest);
305-
jsonStreamStringify.pipe(postRequest);
306-
return duplexer(jsonStreamStringify, postRequest);
303+
return stream.compose(
304+
JSONStream.stringify(),
305+
undici.pipeline(optionsRequest, ({ statusCode, headers, body }) => {
306+
// TODO:
307+
return body
308+
})
309+
)
307310
}
308311

309312
/**

0 commit comments

Comments
 (0)