fix(converters): ensure insomnia variables are strings before matching#7714
fix(converters): ensure insomnia variables are strings before matching#7714jayesh70599 wants to merge 1 commit intousebruno:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Description
Fixes #7687
The Problem
When importing Insomnia collections in YAML format, unquoted values (such as dates, numbers, or booleans) are parsed as non-string JavaScript types. Because the
normalizeVariablesfunction immediately calls.match()on these values, it triggers aTypeError: value.match is not a function, causing the entire import process to crash.The Fix
I have updated the
normalizeVariablesfunction inpackages/bruno-converters/src/insomnia/insomnia-to-bruno.jsto explicitly cast incoming values to aString.value != null) to ensure thatnullorundefineddefault to an empty string.0(number) orfalse(boolean) are correctly converted to"0"and"false"rather than being treated as falsy and erased.Verification
TypeErrorin the console before the fix.Summary by CodeRabbit
0andfalse, instead of converting them to empty strings.