diff --git a/lib/json_parser.js b/lib/json_parser.js index 7405993..73824d2 100644 --- a/lib/json_parser.js +++ b/lib/json_parser.js @@ -26,17 +26,7 @@ JSONParser.prototype.end = function() { fields = Function(`try{return ${data}}catch(e){}`)() || data } - if (typeof fields === 'object') { - if (Array.isArray(fields)) { - this.onField(false, fields) - } else { - for (let field in fields) { - this.onField(field, fields[field]) - } - } - } else { - this.onField(false, fields) - } + this.onField(false, fields) this.data = null this.onEnd() diff --git a/package.json b/package.json index 35f016a..a216da9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gm5/request", - "version": "1.2.4", + "version": "1.2.5", "description": "对Http的request进一步封装, 提供常用的API", "main": "index.js", "author": "yutent",