11import {
2+ VAttributes ,
23 VDelta ,
34 VDeltaOperation ,
45 VDeltaOperationTypes ,
@@ -10,8 +11,6 @@ import {
1011
1112/**
1213 * Attaches ns props to svg element
13- * @param {VElement } vnode - SVG VNode
14- * @returns {VElement }
1514 */
1615export const svg = ( vnode : VElement ) : VElement => {
1716 /* istanbul ignore next */
@@ -31,8 +30,6 @@ export const ns = (tag: string, props: VProps, children?: VNode[]): void => {
3130
3231/**
3332 * Generates a className string based on a classObject
34- * @param {object } classObject - Object with classes paired with boolean values to toggle
35- * @returns {string }
3633 */
3734export const className = ( classObject : Record < string , boolean > ) : string =>
3835 Object . keys ( classObject )
@@ -41,8 +38,6 @@ export const className = (classObject: Record<string, boolean>): string =>
4138
4239/**
4340 * Generates a style string based on a styleObject
44- * @param {object } styleObject - Object with styles
45- * @returns {string }
4641 */
4742export const style = ( styleObject : Record < string , string > ) : string =>
4843 Object . entries ( styleObject )
@@ -51,8 +46,6 @@ export const style = (styleObject: Record<string, string>): string =>
5146
5247/**
5348 * Returns an insert (creation) delta operation
54- * @param {number } positionIdx - Index of delta operation
55- * @returns {VDeltaOperation }
5649 */
5750export const INSERT = ( positionIdx = 0 ) : VDeltaOperation => [
5851 VDeltaOperationTypes . INSERT ,
@@ -61,8 +54,6 @@ export const INSERT = (positionIdx = 0): VDeltaOperation => [
6154
6255/**
6356 * Returns an update (modification) delta operation
64- * @param {number } positionIdx - Index of delta operation
65- * @returns {VDeltaOperation }
6657 */
6758export const UPDATE = ( positionIdx = 0 ) : VDeltaOperation => [
6859 VDeltaOperationTypes . UPDATE ,
@@ -71,8 +62,6 @@ export const UPDATE = (positionIdx = 0): VDeltaOperation => [
7162
7263/**
7364 * Returns an delete (removal) delta operation
74- * @param {number } positionIdx - Index of delta operation
75- * @returns {VDeltaOperation }
7665 */
7766export const DELETE = ( positionIdx = 0 ) : VDeltaOperation => [
7867 VDeltaOperationTypes . DELETE ,
@@ -81,11 +70,6 @@ export const DELETE = (positionIdx = 0): VDeltaOperation => [
8170
8271/**
8372 * Helper method for creating a VNode
84- * @param {string } tag - The tagName of an HTMLElement
85- * @param {VProps= } props - DOM properties and attributes of an HTMLElement
86- * @param {VNode[]= } children - Children of an HTMLElement
87- * @param {VFlags= } flag - Compiler flag for VNode
88- * @returns {VElement }
8973 */
9074export const m = (
9175 tag : string ,
@@ -95,13 +79,19 @@ export const m = (
9579 delta ?: VDelta ,
9680) : VElement => {
9781 let key ;
82+ let attributes ;
9883 if ( props ?. key ) {
9984 key = < string | undefined > props . key ;
10085 delete props . key ;
10186 }
87+ if ( props ?. attributes ) {
88+ attributes = < VAttributes > props . attributes ;
89+ delete props . attributes ;
90+ }
10291 return {
10392 tag,
10493 props,
94+ attributes,
10595 children,
10696 key,
10797 flag,
0 commit comments