Skip to content

Update Whois to remove the leading space in front of email #470

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

Merged
merged 2 commits into from
Jun 9, 2025

Conversation

earlduque
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@chelming chelming left a comment

Choose a reason for hiding this comment

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

you could do it all in one line with

message_body = message_body.replace(/^\s*/gm,'').match(/^(real_name|tz_label|email):.*$/gm).join('\n');

if any other fields get added we wouldn't have to worry about leading spaces then 🤷

or just change the replace line in yours to .replace(/^\s*/gm,'')

@@ -37,6 +37,7 @@ if (current.channel == "GD51HTR46" || current.channel == "G9LAJG7G8" || current.
}

message_body = message_body.match(/^(real_name|tz_label| {2}email):.*$/gm).join('\n');
message_body = message_body.replace(/^\s{2}(email)/gm, '$1');
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could trim before joining in case we ever have other indented lines.

@earlduque earlduque merged commit 07bb923 into ServiceNowDevProgram:main Jun 9, 2025
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.

3 participants