- 
                Notifications
    You must be signed in to change notification settings 
- Fork 26
fix: update decoded data param types #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| ESLint Summary View Full Report
 
 
 Report generated by eslint-plus-action | 
        
          
                src/types/decoded-data.ts
              
                Outdated
          
        
      | name: string | ||
| type: string | ||
| value: string | ||
| value: string | ParamValue[] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value: ParamValue perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't that type leave out the nested arrays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied your suggestion after changing the type ParamValue = (string | ParamValue)[] as per @iamacook suggestion
        
          
                src/types/decoded-data.ts
              
                Outdated
          
        
      | data: string | ||
| } | ||
|  | ||
| type ParamValue = string | string[] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change this to reference itself, you can use it as value without needing arrays of arrays.
| type ParamValue = string | string[] | |
| type ParamValue = string | (string | ParamValue)[] | 
3f6a32d    to
    9edc6a8      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now!
        
          
                src/types/decoded-data.ts
              
                Outdated
          
        
      | data: string | ||
| } | ||
|  | ||
| type ParamValue = string | (string | ParamValue)[] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need the second string.
type ParamValue = string | ParamValue[] is already recursive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's right. Just changed it
9edc6a8    to
    b70cb5c      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| Please also bump the version in package.json if you want to release it on npm. | 
| Bumped the version in  | 

Update decoded-data endpoint return types.
From https://gnosis.github.io/safe-client-gateway/docs/common/models/data_decoded/enum.ParamValue.html , the params value can be contain nested
string[]