@exodus/errors 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [1.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/errors@1.0.0...@exodus/errors@1.0.1) (2024-07-30)
7
+
8
+ ### Bug Fixes
9
+
10
+ - keep clarifying comments ([#8131](https://github.com/ExodusMovement/exodus-hydra/issues/8131)) ([2679da9](https://github.com/ExodusMovement/exodus-hydra/commit/2679da9aeba497b9f3259c8d57e1aea9d37e8b90))
package/lib/sanitize.js CHANGED
@@ -1,6 +1,13 @@
1
1
  const sanitizeErrorMessage = (message) => message
2
+ // 12 word phrase
2
3
  .replaceAll(/(?:[A-Za-z]{3,20}\s+){11}[A-Za-z]{3,20}/g, '****')
4
+ // hex
3
5
  .replaceAll(/(?:0x)?[\dA-Fa-f]{20,}/g, '****')
6
+ // base58
7
+ // https://stackoverflow.com/a/33060399
4
8
  .replaceAll(/[1-9A-HJ-NP-Za-km-z]{50,}/g, '****')
9
+ // base64
10
+ // adapted from https://stackoverflow.com/a/5885097
11
+ // added `{3,}` to match at least 12 characters
5
12
  .replaceAll(/(?:[\d+/A-Za-z]{4}){3,}(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=|[\d+/A-Za-z]{4})/g, '****');
6
13
  export default sanitizeErrorMessage;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exodus/errors",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "Utilities for error handling in client code, such as sanitization",
6
6
  "author": "Exodus Movement, Inc.",
7
7
  "repository": {
@@ -34,5 +34,5 @@
34
34
  "devDependencies": {
35
35
  "@exodus/errors-fixture": "^1.0.0"
36
36
  },
37
- "gitHead": "c56db0c4232e4d7b20d2848ee661b1530774fce8"
37
+ "gitHead": "0d8159f0439781615acfe284ce978b35ae228fb5"
38
38
  }