That removes the `{var}` of the $name of the asset if the collection output already has it to avoid `output_{var}_asset.{var}_1.js` issue reported in https://github.com/symfony/AsseticBundle/issues/182.
I'll move it in a private method.