11import sax from "sax" ;
22import parseMustaches from "./stache.js" ;
33import { isHole } from "./hole.js" ;
4- import { create as createVNode , VNode , Attrs } from "./vnode.js" ;
4+ import { create as createVNode , VNode , Props } from "./vnode.js" ;
55import * as logger from "./logger.js" ;
66
77/** Parse a template into a simple JSON markup representation */
@@ -23,8 +23,8 @@ export const parse = (markup: string): VNode => {
2323 parser . onopentag = ( node ) => {
2424 // We've turned off the namespace feature, so node attributes will
2525 // contain only string values, not QualifiedAttribute objects.
26- const attrs = parseAttrs ( node . attributes as { [ key : string ] : string } ) ;
27- const next = createVNode ( node . name , attrs ) ;
26+ const props = parseProps ( node . attributes as { [ key : string ] : string } ) ;
27+ const next = createVNode ( node . name , props ) ;
2828 const top = getTop ( stack ) ;
2929 if ( ! top ) {
3030 throw new ParseError ( `No parent tag for ${ node . name } ` ) ;
@@ -61,8 +61,8 @@ export default parse;
6161
6262const getTop = ( stack : Array < VNode > ) : VNode | null => stack . at ( - 1 ) ?? null ;
6363
64- const parseAttrs = ( attrs : { [ key : string ] : string } ) : Attrs => {
65- const result : Attrs = { } ;
64+ const parseProps = ( attrs : { [ key : string ] : string } ) : Props => {
65+ const result : Props = { } ;
6666 for ( const [ key , value ] of Object . entries ( attrs ) ) {
6767 const parsed = parseMustaches ( value ) ;
6868 const first = parsed . at ( 0 ) ;
0 commit comments