Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #43 from jmeas/1.3.2
Browse files Browse the repository at this point in the history
1.3.2
  • Loading branch information
jamesplease authored Oct 17, 2016
2 parents 942694b + af15bd3 commit d970b34
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### [1.3.2](https://github.com/jmeas/backbone.base-router/releases/tag/1.3.2)

- Update to support Lodash v4

### [1.3.1](https://github.com/jmeas/backbone.base-router/releases/tag/1.3.1)

- Updated dependencies to include the latest Backbone versions.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone.base-router",
"version": "1.3.1",
"version": "1.3.2",
"homepage": "https://github.com/jmeas/backbone.base-router",
"authors": [
"Jmeas <jellyes2@gmail.com>"
Expand Down
12 changes: 8 additions & 4 deletions dist/backbone.base-router.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.BaseRouter v1.3.0
// Backbone.BaseRouter v1.3.2
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['backbone', 'underscore'], function(Backbone, _) {
Expand Down Expand Up @@ -47,7 +47,9 @@
routeStr = origRoute;
}

this.routeParams[origRoute] = _.invoke(routeStr.match(NAMED_PARAM), 'slice', 1);
this.routeParams[origRoute] = _.map(routeStr.match(NAMED_PARAM), function (param) {
return param.slice(1);
});

// Begin setting up our routeData,
// based on what we already know.
Expand Down Expand Up @@ -122,8 +124,10 @@

var routeKeys = this.routeParams[route];
var routeValues = routeParams.slice(0, routeKeys.length);

return _.object(_.zip(routeKeys, routeValues));
return _.reduce(_.zip(routeKeys, routeValues), function (obj, opts) {
obj[opts[0]] = opts[1];
return obj;
}, {});
}
});

Expand Down
4 changes: 2 additions & 2 deletions dist/backbone.base-router.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/backbone.base-router.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone.base-router",
"version": "1.3.1",
"version": "1.3.2",
"description": "A better starting point for a new Backbone Router.",
"main": "dist/backbone.base-router.js",
"directories": {
Expand Down

0 comments on commit d970b34

Please sign in to comment.