File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
libs/ts/decoders/src/encode-packed/utils Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -6,22 +6,19 @@ import { generateDecoderStringBytes as generateDecoderStringBytesCancun } from '
66
77import type { DecoderImplementations } from './types' ;
88
9- export const checkForDynamicData = ( fields : ExpandedFieldOrArray [ ] ) => {
10- let containsDynamicData = false ;
11-
12- fields . forEach ( field => {
9+ export const checkForDynamicData = (
10+ fields : ExpandedFieldOrArray [ ] ,
11+ ) : boolean => {
12+ return fields . some ( ( field : ExpandedFieldOrArray ) => {
1313 if ( Array . isArray ( field ) ) {
14- containsDynamicData = containsDynamicData || checkForDynamicData ( field ) ;
14+ return checkForDynamicData ( field ) ;
1515 } else if ( field . isDynamic ) {
16- containsDynamicData = true ;
17- return ;
16+ return true ;
1817 } else if ( 'components' in field ) {
19- containsDynamicData =
20- containsDynamicData || checkForDynamicData ( field . components ! ) ;
18+ return checkForDynamicData ( field . components ! ) ;
2119 }
20+ return false ;
2221 } ) ;
23-
24- return containsDynamicData ;
2522} ;
2623
2724export const decoderImplementationsMap : Record <
You can’t perform that action at this time.
0 commit comments