diff --git a/index.js b/index.js index 521e828..f02edeb 100644 --- a/index.js +++ b/index.js @@ -183,7 +183,7 @@ USPProto.keys = USPProto.keys || function() { var items = []; this.forEach(function(item, name) { - items.push([name]); + items.push(name); }); return makeIterator(items); }; @@ -197,7 +197,7 @@ USPProto.values = USPProto.values || function() { var items = []; this.forEach(function(item) { - items.push([item]); + items.push(item); }); return makeIterator(items); }; diff --git a/package.json b/package.json index 6dce230..191df29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "url-search-params-polyfill", - "version": "3.0.0", + "version": "4.0.0", "description": "a simple polyfill for javascript URLSearchParams", "homepage": "https://github.com/jerrybendy/url-search-params-polyfill", "main": "index.js", diff --git a/test/index.test.js b/test/index.test.js index 9f0f801..5e2d6d4 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -228,6 +228,8 @@ describe(PREFIX + 'Iterator', function () { ret.push(key); } expect(ret.join(';')).to.be.equal('a;b;c'); + + expect(Array.from(obj.keys())).to.be.eql(['a','b','c']); }); it('values', function () { @@ -237,6 +239,8 @@ describe(PREFIX + 'Iterator', function () { ret.push(value); } expect(ret.join(';')).to.be.equal('1;2;3'); + + expect(Array.from(obj.values())).to.be.eql(['1', '2', '3']); }); });