File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
packages/cli/src/scaffold Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @graphprotocol/graph-cli ' : patch
3+ ---
4+
5+ ` graph init ` : fix tests generation for events with [ ] [ ] params #1878
Original file line number Diff line number Diff line change @@ -119,7 +119,13 @@ const isNativeType = (type: string) => {
119119 return natives . some ( rx => rx . test ( type ) ) ;
120120} ;
121121
122- const fetchArrayInnerType = ( type : string ) => type . match ( / A r r a y < ( .* ?) > / ) ;
122+ // get inner type: Array<T> -> T, Array<Array<T>> -> T
123+ const fetchArrayInnerType = ( type : string ) : RegExpMatchArray | null => {
124+ const match = type . match ( / A r r a y < ( .+ ) > / ) ;
125+ if ( ! match ) return null ;
126+
127+ return fetchArrayInnerType ( match [ 1 ] ) || match ;
128+ } ;
123129
124130// Generates the example test.ts file
125131const generateExampleTest = (
You can’t perform that action at this time.
0 commit comments