fix: prevent redactString RangeError and redactNumber NaN#3717
fix: prevent redactString RangeError and redactNumber NaN#3717Abhishek01samal wants to merge 1 commit into
Conversation
|
|
Hi @Abhishek01samal, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis pull request updates the redaction utilities in Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes two bugs in
redactString/redactNumberinutil.ts:redactStringcrashes withRangeErrorwhenvalue.length < endredactNumberreturnedNaNbecauseNumber("12345*****")is invalidChanges
Math.max(0, ...)safeguard to prevent negative repeat countsredactNumberto return the redacted string directlyTesting
Tested with:
Verified: