fix: mock array bug

This commit is contained in:
suxiaoxin 2017-10-13 17:27:44 +08:00
parent 41d212a2dc
commit 98de993e7c

View File

@ -11,7 +11,10 @@ function mock(mockJSON, context) {
return parse(mockJSON);
function parse(p, c) {
c = c || {};
if(!c){
c = Array.isArray(p) ? [] : {}
}
for (var i in p) {
if (!p.hasOwnProperty(i)) {
continue;