Переглянути джерело

Simplified creating options.

Eugene Lazutkin 3 роки тому
батько
коміт
bb631a2d7a
3 змінених файлів з 4 додано та 4 видалено
  1. 1 1
      src/asStream.js
  2. 1 1
      src/utils/fromIterable.js
  3. 2 2
      src/utils/reduceStream.js

+ 1 - 1
src/asStream.js

@@ -112,7 +112,7 @@ const asStream = (fn, options) => {
   };
 
   stream = new Duplex(
-    Object.assign({}, {writableObjectMode: true, readableObjectMode: true}, options, {
+    Object.assign({writableObjectMode: true, readableObjectMode: true}, options, {
       write(chunk, encoding, callback) {
         processChunk(chunk, encoding).then(
           () => callback(null),

+ 1 - 1
src/utils/fromIterable.js

@@ -117,7 +117,7 @@ const fromIterable = options => {
   };
 
   stream = new Readable(
-    Object.assign({}, {objectMode: true}, options, {
+    Object.assign({objectMode: true}, options, {
       read() {
         resume();
       }

+ 2 - 2
src/utils/reduceStream.js

@@ -17,8 +17,8 @@ const reduceStream = (options, initial) => {
   }
 
   const stream = new Writable(
-    Object.assign({}, {objectMode: true}, options, {
-      write(chunk, encoding, callback) {
+    Object.assign({objectMode: true}, options, {
+      write(chunk, _, callback) {
         const result = reducer.call(this, this.accumulator, chunk);
         if (result && typeof result.then == 'function') {
           result.then(