@opra/core 0.31.9 → 0.31.11

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.
@@ -40,12 +40,13 @@ class MultipartIterator extends events_1.EventEmitter {
40
40
  return this._items;
41
41
  }
42
42
  getNext() {
43
- if (this._form.ended)
44
- return Promise.resolve(undefined);
45
- this.resume();
43
+ if (!this._form.ended)
44
+ this.resume();
46
45
  return new Promise((resolve, reject) => {
47
46
  if (this._stack.length)
48
47
  return resolve(this._stack.shift());
48
+ if (this._form.ended)
49
+ return resolve(undefined);
49
50
  this.once('item', () => resolve(this._stack.shift()));
50
51
  this.once('error', (e) => reject(e));
51
52
  });
@@ -36,12 +36,13 @@ export class MultipartIterator extends EventEmitter {
36
36
  return this._items;
37
37
  }
38
38
  getNext() {
39
- if (this._form.ended)
40
- return Promise.resolve(undefined);
41
- this.resume();
39
+ if (!this._form.ended)
40
+ this.resume();
42
41
  return new Promise((resolve, reject) => {
43
42
  if (this._stack.length)
44
43
  return resolve(this._stack.shift());
44
+ if (this._form.ended)
45
+ return resolve(undefined);
45
46
  this.once('item', () => resolve(this._stack.shift()));
46
47
  this.once('error', (e) => reject(e));
47
48
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/core",
3
- "version": "0.31.9",
3
+ "version": "0.31.11",
4
4
  "description": "Opra schema package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@browsery/type-is": "^0.6.3",
32
- "@opra/common": "^0.31.9",
32
+ "@opra/common": "^0.31.11",
33
33
  "accepts": "^1.3.8",
34
34
  "content-disposition": "^0.5.4",
35
35
  "content-type": "^1.0.5",