Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passthrough fingerprinted paths #41

Merged

Conversation

krallin
Copy link
Contributor

@krallin krallin commented Jun 7, 2018

If a path is already fingerprinted (e.g. because the {{asset-map}}
helper was used with a string that got replaced at build time), we can
return the fingerprinted file (i.e. the input we just got), rather than
undefined.

Note: this doesn't however require that the fingerprinted path be
correct: if it's not in the asset map, it won't be included.

If a path is already fingerprinted (e.g. because the {{asset-map}}
helper was used with a string that got replaced at build time), we can
return the fingerprinted file (i.e. the input we just got), rather than
`undefined`.

Note: this doesn't however require that the fingerprinted path be
correct: if it's not in the asset map, it won't be included.
const map = get(this, 'map');
const ret = {};

const identity = Object.keys(map).forEach(k => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest making it a reduce:

const map = get(this, 'map');

return Object.keys(map).reduce((acc, key) => {
  const value = map[k];
  return { [k]: value, value };
}, {});

@RuslanZavacky RuslanZavacky merged commit 44ccc83 into adopted-ember-addons:master Oct 29, 2018
@RuslanZavacky
Copy link
Contributor

Thank you! Will try to merge most PRs and will test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants