Skip to content

Commit

Permalink
Merge pull request angular-ui#2521 from royteeuwen/fix-yuicompressor
Browse files Browse the repository at this point in the history
fix($urlMatcherFactory): Fix to make the YUI Javascript compressor work
  • Loading branch information
nateabele committed Feb 4, 2016
2 parents 508f9ce + ad9c41d commit ac865f2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/urlMatcherFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,27 +599,27 @@ function $UrlMatcherFactory() {
function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, "/").replace(/~~/g, "~") : val; }

var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {
string: {
"string": {
encode: valToString,
decode: valFromString,
// TODO: in 1.0, make string .is() return false if value is undefined/null by default.
// In 0.2.x, string params are optional by default for backwards compat
is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; },
pattern: /[^/]*/
},
int: {
"int": {
encode: valToString,
decode: function(val) { return parseInt(val, 10); },
is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },
pattern: /\d+/
},
bool: {
"bool": {
encode: function(val) { return val ? 1 : 0; },
decode: function(val) { return parseInt(val, 10) !== 0; },
is: function(val) { return val === true || val === false; },
pattern: /0|1/
},
date: {
"date": {
encode: function (val) {
if (!this.is(val))
return undefined;
Expand All @@ -638,14 +638,14 @@ function $UrlMatcherFactory() {
pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,
capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/
},
json: {
"json": {
encode: angular.toJson,
decode: angular.fromJson,
is: angular.isObject,
equals: angular.equals,
pattern: /[^/]*/
},
any: { // does not encode/decode
"any": { // does not encode/decode
encode: angular.identity,
decode: angular.identity,
equals: angular.equals,
Expand Down

0 comments on commit ac865f2

Please sign in to comment.