[nodejs] Implement missing Header.asMap to return a Map
User description
🔗 Related Issues
Fixes #16339
💥 What does this PR do?
Implement asMap function for Header class
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
- Bug fix (backwards compatible)
PR Type
Enhancement
Description
-
Add
asMap()method to Header class in BiDi network types -
Converts Header object to Map with name and value entries
-
Implements missing functionality for Header serialization
Diagram Walkthrough
flowchart LR
A["Header class"] --> B["asMap() method"]
B --> C["Map with name/value"]
C --> D["Serialized Header data"]
File Walkthrough
| Relevant files | |||
|---|---|---|---|
| Enhancement |
|
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
| ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪ |
| 🧪 No relevant tests |
| 🔒 No security concerns identified |
⚡ Recommended focus areas for reviewAPI Consistency
Header.asMap() aligns with surrounding BiDi type serializers; other types may return plain objects. Inconsistent return types could complicate consumers and serialization. |
PR Code Suggestions ✨
Explore these optional code suggestions:
| Category | Suggestion | Impact |
| General |
Ensure consistent nested Map structuresIn the javascript/selenium-webdriver/bidi/networkTypes.js [128-131]
Suggestion importance[1-10]: 6__ Why: The suggestion correctly identifies that converting the nested | Low |
| ||
@ankianan The linter is failing on this.
Can you run ./scripts/format.sh and then update your branch?