File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/components/ParserOpenRPC/InteractiveBox Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -57,11 +57,23 @@ function sortObjectKeysByArray(
5757 return result ;
5858}
5959
60+ function removeEmptyStrings ( obj ) {
61+ for ( const key in obj ) {
62+ if ( obj [ key ] === "" ) {
63+ delete obj [ key ] ;
64+ }
65+ }
66+ return obj ;
67+ }
68+
6069function removeEmptyArrays ( obj : any , params : any [ ] ) {
6170 const newObj = JSON . parse ( JSON . stringify ( obj ) ) ;
6271 for ( const key in newObj ) {
6372 const currentParam = params . find ( item => item . name === key )
6473 if ( newObj . hasOwnProperty ( key ) ) {
74+ if ( ! Array . isArray ( newObj [ key ] ) && typeof newObj [ key ] === "object" ) {
75+ newObj [ key ] = removeEmptyStrings ( newObj [ key ] ) ;
76+ }
6577 if ( currentParam && currentParam . required ) {
6678 return newObj
6779 }
You can’t perform that action at this time.
0 commit comments