Преглед на файлове

Tweaked how custom options are applied.

Eugene Lazutkin преди 3 години
родител
ревизия
aa735c807b
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/index.js

+ 1 - 1
src/index.js

@@ -86,7 +86,7 @@ const wrapFunctions = (fn, index, fns) => {
 
 class Chain extends Duplex {
   constructor(fns, options) {
-    super(options || {writableObjectMode: true, readableObjectMode: true});
+    super(Object.assign({}, {writableObjectMode: true, readableObjectMode: true}, options));
 
     if (!(fns instanceof Array) || !fns.length) {
       throw TypeError("Chain's argument should be a non-empty array.");