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

Gravatar refactor #45

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Conversation

lukasaric
Copy link

This PR refactors gravatar packet into ES6 and also polishes code.

lukasaric and others added 6 commits June 12, 2019 12:44
- Added eslint and editorconfig files ( you can change it as you prefer)
- Changed 'var' into 'const' or 'let'
- Decoupled printAvatar into 2 functions for url and for profile
- Changed if/else into if/ return pattern in most cases
- String concatination replaced with interpolation in most cases
- remove `package-lock.json`, use yarn
- bundling with rollup
- updating `package.json`
- updating tests
- setup linter
- updating ci config
@zcuric
Copy link

zcuric commented Jun 14, 2019

👌 Very nice!

@zcuric
Copy link

zcuric commented Jun 14, 2019

Actually, this solves #44 and #41. 👍

- listing jsonp `callback` param for profile url
- updating readme
if (isBoolean(protocol)) {
url = normalizeUrl(url, { forceHttps: protocol });
}
}
Copy link

Choose a reason for hiding this comment

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

How about this:

let url = cdn ? urlJoin(cdn, '/avatar') : urlJoin(baseUrl, '/avatar');  
// could `let url = urlJoin(cdn || baserUrl, '/avatar');`  work?
if (!cdn &&  isBoolean(protocol)) {
  url = normalizeUrl(url, { forceHttps: protocol });
}

Choose a reason for hiding this comment

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

Nice, thx for suggestion 👍

url = `${cdn}`;
} else {
url = normalizeUrl(baseUrl, { forceHttps: Boolean(protocol) });
}
Copy link

@zcuric zcuric Jun 16, 2019

Choose a reason for hiding this comment

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

Similiar as above:

const url = cdn  ? cdn :  normalizeUrl(baseUrl, { forceHttps: Boolean(protocol) }); 

maybe

const url = cdn || normalizeUrl(baseUrl, { forceHttps: Boolean(protocol) });

would work also?
cdn is string so template literals are obselete.

Choose a reason for hiding this comment

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

Went with second one 😉

@zcuric
Copy link

zcuric commented Jun 26, 2019

@emerleite ping :)

@emerleite
Copy link
Owner

Hey guys, sorry for the delay. Can you wait til the weekend to the review? I'll generate a new version using your contribution.

Thanks :)

@vladimyr
Copy link

vladimyr commented Jun 27, 2019

Sure, take your time 👍


PS As @zcuric already mentioned this resolves #44 & #41 🎉

@PorresM
Copy link

PorresM commented Aug 31, 2019

This PR will also fix vulnerability https://bugzilla.redhat.com/show_bug.cgi?id=1623744 generated by yargs > os-locale > mem and fixed with yargs > 13.0.0.

@emerleite
Copy link
Owner

Perfect @PorresM. Sorry for the delay. I'll try to check this weekend.

@northkode
Copy link

any update? would be nice to support this as rollup -c doesnt support current version when using es6

@zcuric
Copy link

zcuric commented Oct 21, 2019

Ping.

@bvallelunga
Copy link

Hey guys, do you know if this PR fixes this vulnerability: https://npmjs.com/advisories/1500

Also @emerleite would it be possible to get this PR reviewed? I personally would love to see this PR merged.

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

Successfully merging this pull request may close these issues.

7 participants