-
Notifications
You must be signed in to change notification settings - Fork 51
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
Treat special chars and more #3728
Conversation
Signed-off-by: Martin Zeithaml <[email protected]>
PAX build 4471 SUCCEEDED. |
Test workflow 3898 is started. |
Test workflow 3899 is started. |
Signed-off-by: Martin Zeithaml <[email protected]>
PAX build 4472 SUCCEEDED. |
Test workflow 3900 is started. |
Signed-off-by: Martin Zeithaml <[email protected]>
PAX build 4473 SUCCEEDED. |
Test workflow 3902 is started. |
PAX build 4475 SUCCEEDED. |
Test workflow 3903 is started. |
Signed-off-by: Martin Zeithaml <[email protected]>
PAX build 4481 SUCCEEDED. |
Test workflow 3910 is started. |
PAX build 4483 SUCCEEDED. |
Test workflow 3913 is started. |
Signed-off-by: Martin Zeithaml <[email protected]>
PAX build 4490 SUCCEEDED. |
Signed-off-by: Martin Zeithaml <[email protected]>
PAX build 4503 SUCCEEDED. |
Test workflow 3931 is started. |
Signed-off-by: Martin Zeithaml <[email protected]>
PAX build 4516 SUCCEEDED. |
Test workflow 3944 is started. |
export function escapeDollar(str: string): string | undefined { | ||
if (str === null || str === undefined) | ||
return undefined; | ||
return str.replace(/[$]/g, '\\$&'); |
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.
can you explain what the ampersand '&' does here?
I'm not familiar with it and a quick search didnt tell me why it is here.
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.
Explanation here.
$&
= inserts the matched substring.
It is better to show on the second replacement:
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
: any character from []
found, replace by backslash and that character.
The first replace is just for one char, but the replacement is in general form. It can be changed to str.replace(/[$]/g, '\\$');
if it makes the code better to read. This or that, it will work the same.
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.
okay now i understand. i thought $& was a shell thing, i didn't realize it was a javascript thing.
PAX build 4542 SUCCEEDED. |
Test workflow 3972 is started. |
Signed-off-by: Martin Zeithaml <[email protected]>
PAX build 4551 SUCCEEDED. |
This commit is changing the behavior of |
Test workflow 3981 is started. |
@@ -109,7 +109,7 @@ export function ensureFileEncoding(file: string, expectedSample: string, expecte | |||
} | |||
} | |||
common.printTrace(`- Remove encoding tag of ${file}.`); | |||
zos.changeTag(file, 0); |
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.
Will this cause any change in zwe
performance?
PAX build 4552 SUCCEEDED. |
Test workflow 3982 is started. |
Please check if your PR fulfills the following requirements. This is simply a reminder of what we are going to look for before merging your PR. If you don't know all of this information when you create this PR, don't worry. You can edit this template as you're working on it.
PR type
What type of changes does your PR introduce to Zowe? Put an
x
in the box that applies to this PR. If you're unsure about any of them, don't hesitate to ask.Relevant issues
Fixes #3648
Changes proposed in this PR
stripMemberName
can handle special chars nowzos-dataset
functions can handle dollar signtsoCommand
will finally work due to proper syntaxBonus (for free)
changeTag
is changing the tag!Does this PR introduce a breaking change?
Does this PR do something the person installing Zowe should know about?
Better experience.