Skip to content

Commit

Permalink
Bug 871700 - filter out duplicate tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher De Cairos committed May 29, 2013
1 parent 0f763a0 commit b56801d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion routes/make.js
Expand Up @@ -35,7 +35,9 @@ module.exports = function( makeCtor, env ) {
if ( field in body ) {
// arrays need to be concatenated to avoid overwriting elements in the original.
if ( Array.isArray( make[ field ] ) ) {
make[ field ] = make[ field ].concat( body[ field ] );
make[ field ] = make[ field ].concat( body[ field ] ).filter(function( tag, pos, arr ) {
return arr.indexOf( tag ) === pos;
});
} else {
make[ field ] = body[ field ];
}
Expand Down

0 comments on commit b56801d

Please sign in to comment.