mirror of
https://github.com/YMFE/yapi.git
synced 2024-11-27 04:40:08 +08:00
fix: mock array bug
This commit is contained in:
parent
41d212a2dc
commit
98de993e7c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user