@rsdoctor/utils 1.6.3-beta.0 → 1.6.3

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/dist/common.cjs CHANGED
@@ -550,7 +550,16 @@ for(var __rspack_i in (()=>{
550
550
  if (0 === shardingFiles.length) return [];
551
551
  let decoder = new external_string_decoder_namespaceObject.StringDecoder('utf8'), jsonParts = [];
552
552
  await new Promise((resolve, reject)=>{
553
- (0, external_stream_.pipeline)(external_stream_.Readable.from(decodeBase64Shards(shardingFiles, fetchImplement)), (0, external_zlib_.createInflate)(), new external_stream_.Writable({
553
+ let iterator, reading;
554
+ (0, external_stream_.pipeline)((iterator = decodeBase64Shards(shardingFiles, fetchImplement)[Symbol.asyncIterator](), reading = !1, new external_stream_.Readable({
555
+ read () {
556
+ reading || (reading = !0, iterator.next().then(({ value, done })=>{
557
+ reading = !1, this.push(done ? null : value);
558
+ }, (error)=>{
559
+ reading = !1, this.destroy(error);
560
+ }));
561
+ }
562
+ })), (0, external_zlib_.createInflate)(), new external_stream_.Writable({
554
563
  write (chunk, _encoding, callback) {
555
564
  jsonParts.push(decoder.write(external_buffer_.Buffer.from(chunk))), callback();
556
565
  }
package/dist/common.js CHANGED
@@ -196,7 +196,16 @@ async function fetchShardingData(shardingFiles, fetchImplement) {
196
196
  if (0 === shardingFiles.length) return [];
197
197
  let decoder = new StringDecoder('utf8'), jsonParts = [];
198
198
  await new Promise((resolve, reject)=>{
199
- pipeline(Readable.from(decodeBase64Shards(shardingFiles, fetchImplement)), createInflate(), new Writable({
199
+ let iterator, reading;
200
+ pipeline((iterator = decodeBase64Shards(shardingFiles, fetchImplement)[Symbol.asyncIterator](), reading = !1, new Readable({
201
+ read () {
202
+ reading || (reading = !0, iterator.next().then(({ value, done })=>{
203
+ reading = !1, this.push(done ? null : value);
204
+ }, (error)=>{
205
+ reading = !1, this.destroy(error);
206
+ }));
207
+ }
208
+ })), createInflate(), new Writable({
200
209
  write (chunk, _encoding, callback) {
201
210
  jsonParts.push(decoder.write(Buffer.from(chunk))), callback();
202
211
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/utils",
3
- "version": "1.6.3-beta.0",
3
+ "version": "1.6.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -101,7 +101,7 @@
101
101
  "picocolors": "^1.1.1",
102
102
  "rslog": "^2.1.2",
103
103
  "strip-ansi": "^7.2.0",
104
- "@rsdoctor/types": "1.6.3-beta.0"
104
+ "@rsdoctor/types": "1.6.3"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@types/babel__code-frame": "7.27.0",