From 84273469ab4f390a33672c77d760e12776f85f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Tue, 22 Jun 2021 20:19:23 +0800 Subject: [PATCH] update --- lib/json_parser.js | 12 +----------- package.json | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) 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",