File tree Expand file tree Collapse file tree 4 files changed +21
-12
lines changed Expand file tree Collapse file tree 4 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 1+ export default function isStyledComponent ( target ) {
2+ return target && typeof target . generatedClassName === 'string'
3+ }
Original file line number Diff line number Diff line change 1+
2+ import domElements from './domElements'
3+
4+ export default function isTag ( target ) {
5+ if ( typeof target === 'string' ) {
6+ return domElements . indexOf ( target ) !== - 1
7+ }
8+ }
Original file line number Diff line number Diff line change 1- import domElements from './domElements'
1+ import isTag from './isTag'
2+ import isVueComponent from './isVueComponent'
3+ import isStyledComponent from './isStyledComponent'
24
3- export default function isValidElementType ( tag ) {
4- if ( typeof tag === 'undefined' || typeof tag === 'number' ) {
5- return false
6- }
7- if ( typeof tag === 'string' ) {
8- return domElements . indexOf ( tag ) !== - 1
9- }
10- if ( typeof tag === 'object' ) {
11- return ! ! tag . template || ! ! tag . withComponent || ! ! tag . functional
12- }
13- return true
5+ export default function isValidElementType ( target ) {
6+ return isTag ( target ) ||
7+ isVueComponent ( target ) ||
8+ isStyledComponent ( target )
149}
Original file line number Diff line number Diff line change 1+ export default function isVueComponent ( target ) {
2+ return target && typeof target . render === 'function'
3+ }
You can’t perform that action at this time.
0 commit comments