@@ -44,6 +44,7 @@ const addConfig = t => (path, displayName, componentId) => {
4444 if (
4545 existingConfig &&
4646 existingConfig . arguments . length &&
47+ Array . isArray ( existingConfig . arguments [ 0 ] . properties ) &&
4748 ! existingConfig . arguments [ 0 ] . properties . some ( prop =>
4849 [ 'displayName' , 'componentId' ] . includes ( prop . key . name )
4950 )
@@ -59,6 +60,7 @@ const addConfig = t => (path, displayName, componentId) => {
5960 path . node . callee . callee . property . name &&
6061 path . node . callee . callee . property . name == 'withConfig' &&
6162 path . node . callee . arguments . length &&
63+ Array . isArray ( path . node . callee . arguments [ 0 ] . properties ) &&
6264 ! path . node . callee . arguments [ 0 ] . properties . some ( prop =>
6365 [ 'displayName' , 'componentId' ] . includes ( prop . key . name )
6466 )
@@ -216,6 +218,8 @@ export default t => (path, state) => {
216218 path . node . callee . callee . property &&
217219 path . node . callee . callee . property . name &&
218220 path . node . callee . callee . property . name === 'withConfig' &&
221+ path . node . callee . arguments . length &&
222+ Array . isArray ( path . node . callee . arguments [ 0 ] . properties ) &&
219223 ! path . node . callee . arguments [ 0 ] . properties . some ( prop =>
220224 [ 'displayName' , 'componentId' ] . includes ( prop . key . name )
221225 ) )
0 commit comments