Skip to content

Commit

Permalink
Issue #140: replace util/StringUtils with mout/string
Browse files Browse the repository at this point in the history
- Removed util/StringUtils and unit tests
- Replaced usage of StringUtils#format in Controller#url with
  mout/string/interpolate
  • Loading branch information
zship committed Jul 31, 2014
1 parent 8e1b04f commit 850a816
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 104 deletions.
5 changes: 3 additions & 2 deletions src/mvc/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define(function(require) {
var Connectivity = require('lavaca/net/Connectivity'),
History = require('lavaca/net/History'),
Disposable = require('lavaca/util/Disposable'),
StringUtils = require('lavaca/util/StringUtils');
interpolate = require('mout/string/interpolate');

/**
* Base type for controllers
Expand Down Expand Up @@ -74,7 +74,8 @@ define(function(require) {
* @return {String} The formatted URL
*/
url: function(str, args) {
return StringUtils.format(str, args, encodeURIComponent);
args = args.map(window.encodeURIComponent);
return interpolate(str, args, /\{(.+?)\}/);
},
/**
* Directs the user to another route
Expand Down
84 changes: 0 additions & 84 deletions src/util/StringUtils.js

This file was deleted.

18 changes: 0 additions & 18 deletions test/unit/util/StringUtils.js

This file was deleted.

0 comments on commit 850a816

Please sign in to comment.