fix: avoid mutating context in getIdentifierFromClaimInfo#69
fix: avoid mutating context in getIdentifierFromClaimInfo#69Ocheretovich wants to merge 1 commit intoreclaimprotocol:mainfrom
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/utils/claims.ts (1)
100-100: Tiny cleanup: remove redundant fallback in template literal.
contextis already normalized to a string, so${context}is sufficient.Suggested simplification
- const str = `${info.provider}\n${info.parameters}\n${context || ''}` + const str = `${info.provider}\n${info.parameters}\n${context}`🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/utils/claims.ts` at line 100, The template literal that builds str uses a redundant fallback for context; update the expression in the assignment of str to use `${context}` instead of `${context || ''}` since context is already normalized to a string (keep the rest as `${info.provider}\n${info.parameters}\n${context}`). Target the line assigning str where info.provider, info.parameters and context are used.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/utils/claims.ts`:
- Line 100: The template literal that builds str uses a redundant fallback for
context; update the expression in the assignment of str to use `${context}`
instead of `${context || ''}` since context is already normalized to a string
(keep the rest as `${info.provider}\n${info.parameters}\n${context}`). Target
the line assigning str where info.provider, info.parameters and context are
used.
Avoids mutating info.context inside getIdentifierFromClaimInfo by using a local variable instead. Keeps behavior identical while making the helper side-effect free
Summary by CodeRabbit