소스 검색

prevent mutating the original config template object

Benoît Hubert 8 년 전
부모
커밋
560e5578b7
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      sandboxApp.js

+ 1 - 1
sandboxApp.js

@@ -267,7 +267,7 @@ app.post('/:repoSlug/examples',
       slug: exampleSlug,
       title,
       category: req.repo.defaultCategory
-    }, exampleTmpl);
+    }, _.cloneDeep(exampleTmpl));
 
     // Prepare files to write
     var targetDir = examplesDir + '/' + repoSlug + '/' + exampleSlug;