Bläddra i källkod

prevent mutating the original config template object

Benoît Hubert 8 år sedan
förälder
incheckning
560e5578b7
1 ändrade filer med 1 tillägg och 1 borttagningar
  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;