瀏覽代碼

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.");