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

Added support for string interpolation. Fixes #20 #23

Merged
merged 17 commits into from
Jun 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion signale.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Signale {
if (args[0] instanceof Error) {
[msg] = args;
} else {
let [{prefix, message, suffix}] = args;
const [{prefix, message, suffix}] = args;
Copy link
Owner

Choose a reason for hiding this comment

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

Original comment: #23 (comment)

msg = message ? util.format(...message) : util.format(...args);
Copy link
Owner

Choose a reason for hiding this comment

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

Original comment: #23 (comment)
(just in case the initial notification didn't make it through)

additional = Object.assign({}, {suffix, prefix});
Copy link
Owner

Choose a reason for hiding this comment

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

Just a minor reordering of the assignments:

const [{prefix, message, suffix}] = args;
additional = Object.assign({}, {suffix, prefix});
msg = message ? util.format(...message) : this._hasAdditional(additional, args);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's better than my previous method

}
Expand Down