@@ -7,7 +7,11 @@ var spaces = require('space-separated-tokens')
77var commas = require ( 'comma-separated-tokens' )
88var style = require ( 'style-to-object' )
99var ns = require ( 'web-namespaces' )
10- var is = require ( 'unist-util-is' )
10+ var convert = require ( 'unist-util-is/convert' )
11+
12+ var root = convert ( 'root' )
13+ var element = convert ( 'element' )
14+ var text = convert ( 'text' )
1115
1216var dashes = / - ( [ a - z ] ) / g
1317
@@ -39,8 +43,8 @@ function wrapper(h, node, options) {
3943 prefix = r === true || v === true || vd === true ? 'h-' : false
4044 }
4145
42- if ( is ( ' root' , node ) ) {
43- if ( node . children . length === 1 && is ( ' element' , node . children [ 0 ] ) ) {
46+ if ( root ( node ) ) {
47+ if ( node . children . length === 1 && element ( node . children [ 0 ] ) ) {
4448 node = node . children [ 0 ]
4549 } else {
4650 node = {
@@ -50,7 +54,7 @@ function wrapper(h, node, options) {
5054 children : node . children
5155 }
5256 }
53- } else if ( ! is ( ' element' , node ) ) {
57+ } else if ( ! element ( node ) ) {
5458 throw new Error (
5559 'Expected root or element, not `' + ( ( node && node . type ) || node ) + '`'
5660 )
@@ -123,9 +127,9 @@ function toH(h, node, ctx) {
123127 while ( ++ index < length ) {
124128 value = children [ index ]
125129
126- if ( is ( ' element' , value ) ) {
130+ if ( element ( value ) ) {
127131 elements . push ( toH ( h , value , ctx ) )
128- } else if ( is ( ' text' , value ) ) {
132+ } else if ( text ( value ) ) {
129133 elements . push ( value . value )
130134 }
131135 }
0 commit comments