Skip to content

Commit

Permalink
refactor inner normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
peutetre committed Apr 28, 2014
1 parent c746fb8 commit 09b0d1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/normalize-timing-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ var matchParenthesis = /(\(.+?\))/g,

normalize = function (match) {
var args = match.substr(1, match.length-2).split(","),
rst = [];
args.forEach(function (arg) {
rst.push(parseFloat(arg.replace(space, emptyString)));
});
rst = args.map(function (arg) {
return parseFloat(arg.replace(space, emptyString));
});
return "(" + rst.join(",") + ")";
};

Expand Down
7 changes: 3 additions & 4 deletions src/normalize-transform-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ var matchParenthesis = /(\(.+?\))/g,

normalize = function (match) {
var args = match.substr(1, match.length-2).split(","),
rst = [];
args.forEach(function (arg) {
rst.push(arg.replace(space, emptyString).replace(zeropixel, zero));
});
rst = args.map(function (arg) {
return arg.replace(space, emptyString).replace(zeropixel, zero);
});
return "(" + rst.join(",") + ")";
};

Expand Down

0 comments on commit 09b0d1d

Please sign in to comment.