-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update TransformEvaluator.ts to include decomposeDiacriticalMarks #89
Update TransformEvaluator.ts to include decomposeDiacriticalMarks #89
Conversation
Adds a very rudimentary decomposeDiacriticalMarks function to the Transform Evaluators. This code requires testing within the plugin itself, but the function to perform the decomposition itself has been tested independently.
Note: I am not great with JavaScript, and I essentially stole existing functions' design and hopefully put together something acceptable. I mostly needed to wrap the I tested the actual core of the method on Mozilla's documentation page here: If you see any changes that need to be made, please feel free to do so, especially from lines 913 to lines 925 regarding the following code:
I have a general understanding of what this does, but do not yet fully understand what all might need to go in here. Assuming that evaluating if it's of type object is a safe bet. I hope this helps! |
According to the IdentityNow developer documentation, they are using 'NFKD' mode, which is the "Compatibility Decomposition" mode. NFD will work, but may have edge cases.
Update: I went ahead and tested the official documentation's usage of the A more complete list might be |
Thank you for your contribution. Also, what would be great is to:
|
Added decomposeDiacriticalMarks() method to stringUtils.ts per Yannick's request. This could be renamed to "removeDiacriticalMarks()" in the future as that is technically its function, but SailPoint's official naming convention dictates "decomposeDiacriticalMarks" so I provided this name for the sake of consistency between systems.
Created the test suite for decomposeDiacriticalMarks() per Yannick's request. This test includes strings provided by SailPoint's documentation, Mozilla's example, and a long string of diacritical characters.
Updated the Release Notes section of the readme to include mention of the decomposeDiacriticalMarks function that was added by Semperverus
Added notes about changes regarding decomposeDiacriticalMarks
Added self as contributor
Included self as contributor
Okay, these are all uploaded. I am not sure on how I would test locally. Is this something you would be able to run @yannick-beot-sp ? |
I'm using the task "Unit Tests" or "Run current mocha test" to execute the test. |
Adds a very rudimentary decomposeDiacriticalMarks function to the Transform Evaluators.
The way this functions is by using the built-in javascript
normalize()
method in 'NFKD' mode to first break a character with diacritical marks up into its constituent unicode components in compatibility mode, and then it performs a regex.replace()
to strip out the diacritical marks in the string. These diacritical marks are located in unicode range\u0300
through\u036F
as referenced in the official unicode documenation (or alternatively the Wikipedia page which is much easier to read)This code requires testing within the plugin itself, but the function to perform the decomposition has been tested independently.
Official SailPoint Developer documenation page for decomposeDiacriticalMarks