From a3c4662b4cf729d18d423f9c4990a5e3607652fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alvaro=20Cabrera=20Dur=C3=A1n?= <pateketrueke@gmail.com>
Date: Fri, 5 Oct 2018 09:16:12 -0500
Subject: [PATCH] Clone input before traversing to avoid unwanted mutations;
 fix #473

---
 src/core/run.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/run.js b/src/core/run.js
index 5a8b8dec..07979b36 100644
--- a/src/core/run.js
+++ b/src/core/run.js
@@ -83,7 +83,7 @@ function resolve(obj, data, values, property) {
 // TODO provide types
 function run(refs, schema, container) {
   try {
-    const result = traverse(schema, [], function reduce(sub, maxReduceDepth, parentSchemaPath) {
+    const result = traverse(utils.merge({}, schema), [], function reduce(sub, maxReduceDepth, parentSchemaPath) {
       if (typeof maxReduceDepth === 'undefined') {
         maxReduceDepth = random.number(1, 3);
       }
-- 
GitLab