@nxtedition/shared 1.0.0 → 1.0.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.
package/index.js CHANGED
@@ -32,7 +32,10 @@ async function* _reader({ sharedState, sharedBuffer }, cb) {
32
32
  const raw = buffer.slice(readPos + 4, readPos + len)
33
33
  readPos += len
34
34
  if (cb) {
35
- cb(raw)
35
+ const thenable = cb(raw)
36
+ if (thenable && typeof thenable.then === 'function') {
37
+ await thenable
38
+ }
36
39
  } else {
37
40
  yield raw
38
41
  }