You're building a virtual DOM system similar to React. The first step is to convert a real DOM tree into an object literal representation that can be serialized, manipulated, and later rendered back to DOM.
Given a real DOM element, convert it to an object literal representation similar to how React represents JSX elements. This process is called "virtualization" - creating a virtual representation of the DOM.
1. Basic Functionality
Convert DOM elements to objects with type and props structure
Handle text nodes as strings
Support single child and multiple children
Convert HTML attributes to camelCase properties (e.g., class → className, data-test → dataTest)