@@ -41,19 +41,19 @@ const importLocalName = (name, state) => {
4141 return localName
4242}
4343
44- export const isStyled = types => ( tag , state ) => {
44+ export const isStyled = t => ( tag , state ) => {
4545 if (
46- types . isCallExpression ( tag ) &&
47- types . isMemberExpression ( tag . callee ) &&
46+ t . isCallExpression ( tag ) &&
47+ t . isMemberExpression ( tag . callee ) &&
4848 tag . callee . property . name !== 'default' /** ignore default for #93 below */
4949 ) {
5050 // styled.something()
51- return isStyled ( types ) ( tag . callee . object , state )
51+ return isStyled ( t ) ( tag . callee . object , state )
5252 } else {
5353 return (
54- ( types . isMemberExpression ( tag ) &&
54+ ( t . isMemberExpression ( tag ) &&
5555 tag . object . name === importLocalName ( 'default' , state ) ) ||
56- ( types . isCallExpression ( tag ) &&
56+ ( t . isCallExpression ( tag ) &&
5757 tag . callee . name === importLocalName ( 'default' , state ) ) ||
5858 /**
5959 * #93 Support require()
@@ -63,31 +63,31 @@ export const isStyled = types => (tag, state) => {
6363 * - styled.default.something()
6464 */
6565 ( state . styledRequired &&
66- types . isMemberExpression ( tag ) &&
67- types . isMemberExpression ( tag . object ) &&
66+ t . isMemberExpression ( tag ) &&
67+ t . isMemberExpression ( tag . object ) &&
6868 tag . object . property . name === 'default' &&
6969 tag . object . object . name === state . styledRequired ) ||
7070 ( state . styledRequired &&
71- types . isCallExpression ( tag ) &&
72- types . isMemberExpression ( tag . callee ) &&
71+ t . isCallExpression ( tag ) &&
72+ t . isMemberExpression ( tag . callee ) &&
7373 tag . callee . property . name === 'default' &&
7474 tag . callee . object . name === state . styledRequired )
7575 )
7676 }
7777}
7878
79- export const isCSSHelper = types => ( tag , state ) =>
80- types . isIdentifier ( tag ) && tag . name === importLocalName ( 'css' , state )
79+ export const isCSSHelper = t => ( tag , state ) =>
80+ t . isIdentifier ( tag ) && tag . name === importLocalName ( 'css' , state )
8181
82- export const isCreateGlobalStyleHelper = types => ( tag , state ) =>
83- types . isIdentifier ( tag ) &&
82+ export const isCreateGlobalStyleHelper = t => ( tag , state ) =>
83+ t . isIdentifier ( tag ) &&
8484 tag . name === importLocalName ( 'createGlobalStyle' , state )
8585
86- export const isInjectGlobalHelper = types => ( tag , state ) =>
87- types . isIdentifier ( tag ) && tag . name === importLocalName ( 'injectGlobal' , state )
86+ export const isInjectGlobalHelper = t => ( tag , state ) =>
87+ t . isIdentifier ( tag ) && tag . name === importLocalName ( 'injectGlobal' , state )
8888
89- export const isKeyframesHelper = types => ( tag , state ) =>
90- types . isIdentifier ( tag ) && tag . name === importLocalName ( 'keyframes' , state )
89+ export const isKeyframesHelper = t => ( tag , state ) =>
90+ t . isIdentifier ( tag ) && tag . name === importLocalName ( 'keyframes' , state )
9191
92- export const isHelper = types => ( tag , state ) =>
93- isCSSHelper ( types ) ( tag , state ) || isKeyframesHelper ( types ) ( tag , state )
92+ export const isHelper = t => ( tag , state ) =>
93+ isCSSHelper ( t ) ( tag , state ) || isKeyframesHelper ( t ) ( tag , state )
0 commit comments