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

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;