소스 검색

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