Herbert Vojčík 7 years ago
parent
commit
591b72d1d1
1 changed files with 8 additions and 3 deletions
  1. 8 3
      lib/cow-value-model.js

+ 8 - 3
lib/cow-value-model.js

@@ -20,9 +20,14 @@ var cowValueModel = exports.cowValueModel = function cowValueModel() {
     }
 
     var keys = [];
-    keyDescriptions.forEach(function (each) {
-        if (typeof each === 'number') keys.push(each);else keys.push.apply(keys, _toConsumableArray(each.toString().split('.')));
-    });
+
+    function fillKeys(keyDescriptions) {
+        keyDescriptions.forEach(function (each) {
+            if (typeof each === 'number') keys.push(each);else if (Array.isArray(each)) fillKeys(each);else keys.push.apply(keys, _toConsumableArray(each.toString().split('.')));
+        });
+    }
+
+    fillKeys(keyDescriptions);
 
     function setField() {
         var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};