Performs regex replace on strings in the Sentry event object.
Warning: The replace is performed recursively on every string in the event object. While this gives great power, an over zealous regex can easily break fingerprinting and/or sourcemaps!
Pass an array of
[Regex, string] pairs to the constructor and then pass the integration to Sentry:
To strip usernames from file paths, in both Electron processes run the following code:
This results in the following replacements in strings:
C:\Users\tim\Documents\some-file.txt > C:\Users\...\Documents\some-file.txt /home/jambo/another-file.dat > /home/.../another-file.dat