From 8e9fdb4c4248cd016aff84a9726c48d0314a49bc Mon Sep 17 00:00:00 2001 From: yeluoqiuzhi <827884374@qq.com> Date: Fri, 7 Jul 2017 20:44:34 +0800 Subject: [PATCH] change to es5 --- index.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 19ab308..2cb9700 100644 --- a/index.js +++ b/index.js @@ -14,15 +14,15 @@ * @return {object} */ function anyQs(url) { - let params = {}; - let tempArr = decodeURI(url) + var params = {}, + tempArr = decodeURI(url) .replace(/\+/g, ' ') .match(/\w+=[^&#?\/]+/g); if (!tempArr) { return {}; } tempArr.forEach(function (item) { - let ps = item.split('='); + var ps = item.split('='); params[ps[0]] = /^\d+(\.\d+)?$/.test(ps[1]) ? parseFloat(ps[1]) : ps[1]; }); diff --git a/package.json b/package.json index f4b24e5..b0a64ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "any-qs", - "version": "1.0.3", + "version": "1.0.4", "description": "parse any query parameters from url", "main": "index.js", "scripts": {