File tree Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 11import css from './css'
22import domElements from '../utils/domElements'
3-
4- // check valid vue-styled-component element type
5- function isValidElementType ( tag ) {
6- if ( typeof tag === 'undefined' || typeof tag === 'number' ) {
7- return false
8- }
9- if ( typeof tag === 'string' ) {
10- return domElements . includes ( tag )
11- }
12- if ( typeof tag === 'object' ) {
13- return ! ! tag . template || ! ! tag . withComponent
14- }
15- return true
16- }
3+ import isValidElementType from '../utils/isValidElementType'
174
185export default ( createStyledComponent ) => {
196 const styled = ( tagName , props = { } ) => {
Original file line number Diff line number Diff line change 1+ import domElements from './domElements'
2+
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 . includes ( tag )
9+ }
10+ if ( typeof tag === 'object' ) {
11+ return ! ! tag . template || ! ! tag . withComponent
12+ }
13+ return true
14+ }
You can’t perform that action at this time.
0 commit comments