-
Notifications
You must be signed in to change notification settings - Fork 52
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
base: master
Are you sure you want to change the base?
Conversation
- 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
9dfeaab
to
44d558d
Compare
5d0770d
to
fbf0a92
Compare
ca44924
to
b4926e2
Compare
b4926e2
to
1892911
Compare
👌 Very nice! |
- listing jsonp `callback` param for profile url
- updating readme
if (isBoolean(protocol)) { | ||
url = normalizeUrl(url, { forceHttps: protocol }); | ||
} | ||
} |
There was a problem hiding this comment.
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 });
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thx for suggestion 👍
packages/gravatar/src/gravatar.ts
Outdated
url = `${cdn}`; | ||
} else { | ||
url = normalizeUrl(baseUrl, { forceHttps: Boolean(protocol) }); | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went with second one 😉
@emerleite ping :) |
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 :) |
- upgrading dependencies
- updating tests
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. |
Perfect @PorresM. Sorry for the delay. I'll try to check this weekend. |
any update? would be nice to support this as rollup -c doesnt support current version when using es6 |
Ping. |
- addressing lint issues
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. |
This PR refactors gravatar packet into ES6 and also polishes code.