refactor: extract storage record utils#259
refactor: extract storage record utils#259ndycode wants to merge 1 commit intorefactor/pr3-storage-account-match-utilsfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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
lib/storage.tsWhat Changed
lib/storage/record-utils.tsisRecord(...)andclampIndex(...)into the new helper modulelib/storage.tsto use the extracted helper without changing storage behaviorValidation
npm run test -- test/storage.test.tsnpm run lintnpm run typechecknpm run buildRisk and Rollback
2ede713to restore the inline record/index helpers inlib/storage.tsAdditional Notes
note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
pure mechanical extraction:
isRecordandclampIndexare moved verbatim fromlib/storage.tsinto the newlib/storage/record-utils.tshelper module. the import is wired up correctly and no storage behavior changes. this continues the ongoinglib/storage.tssplit into reviewable slices.changes:
lib/storage/record-utils.ts— new file exportingisRecordandclampIndex(8 lines, direct copy)lib/storage.ts— removes the two private definitions, adds the import; all 11 call sites are untouchedconcern:
test/storage-record-utils.test.tsadded;isRecordandclampIndexare indirectly exercised bytest/storage.test.tsbut have no direct unit-level edge case coverage — follow the pattern set bytest/storage-flagged.test.tsandtest/named-backup-export.test.tsConfidence Score: 5/5
Important Files Changed
isRecordandclampIndex, copied verbatim fromlib/storage.ts— logic is correct but no dedicated vitest unit test file added./storage/record-utils.js; no behavioral change, all call sites preservedFlowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD ST["lib/storage.ts"] RU["lib/storage/record-utils.ts\n─────────────────────\nisRecord(value)\nclampIndex(index, length)"] ST -->|"import { isRecord, clampIndex }"| RU ST -->|"11 call sites unchanged"| STPrompt To Fix All With AI
Last reviewed commit: "refactor: extract st..."