Просмотр исходного кода

Tweaked how custom options are applied.

Eugene Lazutkin 3 лет назад
Родитель
Сommit
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.");