Add DOM nodeName aliases#1952
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Node base class gains an abstract readonly nodeName property, implemented by Text, Comment, ProcessingInstruction, CDATA, Document, and Element to expose DOM-spec-compatible node name aliases. Tests are updated with a nodeName field on the test Doctype class and a new test verifying nodeName values. ChangesnodeName Property Implementation
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
Adds a DOM-compatible
nodeNamealias to domhandler node classes.domhandleralready exposes several DOM-style aliases such asnodeType,parentNode,childNodes,tagName, andattributes. This adds the commonly usednodeNameproperty for text, comment, CDATA, document, processing instruction, and element nodes without changing the existing internal node model.This is related to #684.
Validation
vitest runtsc --noEmit -p tsconfig.eslint.jsonbiome check src/node.ts src/node.spec.tseslint src/node.ts src/node.spec.tsSummary by CodeRabbit
New Features
nodeNamesupport across node types, including text, comment, CDATA, document, processing instruction, and element nodes.#text,#comment,#document, and tag or target names where applicable.Bug Fixes
Tests
nodeNamealiases and updated cloning-related expectations.