Skip to content

Commit

Permalink
~ 接口变化
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Nov 9, 2016
1 parent a304aef commit c268144
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
"dependencies": {},
"peerDependencies": {
"blear.utils.hashbang": "1.x",
"blear.utils.url": "1.x"
"blear.utils.url": "1.x",
"blear.utils.access": "1.x",
"blear.utils.typeis": "1.x",
"blear.utils.object": "1.x"
},
"devDependencies": {
"jasmine-core": "^2.4.1",
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ var get = exports.get = function () {
* @returns {{path, query}|{path: string, query: *}}
*/
var parse = exports.parse = function () {
return object.filter(url.parse(get()), function (val, key) {
var ret = object.filter(url.parse(get()), function (val, key) {
return PARSE_MAP[key];
});

ret.path = ret.href;
return ret;
};


Expand Down
1 change: 1 addition & 0 deletions test/test.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('测试文件', function () {
console.log(ret);

expect(ret).toEqual({
path: '/a/b/c/?x=1&y=2&z=3',
href: '/a/b/c/?x=1&y=2&z=3',
pathname: '/a/b/c/',
query: {
Expand Down

0 comments on commit c268144

Please sign in to comment.