File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,20 @@ const slotInputDefs = allInputDefs.filter(
7373const widgetInputDefs = allInputDefs .filter ((input ) =>
7474 nodeDefStore .inputIsWidget (input )
7575)
76- const truncateDefaultValue = (value : any ): string => {
77- if (value instanceof Object ) {
78- return _ .truncate (JSON .stringify (value ), { length: 20 })
76+ const truncateDefaultValue = (value : any , charLimit : number = 32 ): string => {
77+ let stringValue: string
78+
79+ if (typeof value === ' object' && value !== null ) {
80+ stringValue = JSON .stringify (value )
81+ } else if (Array .isArray (value )) {
82+ stringValue = JSON .stringify (value )
83+ } else if (typeof value === ' string' ) {
84+ stringValue = value
85+ } else {
86+ stringValue = String (value )
7987 }
80- return value
88+
89+ return _ .truncate (stringValue , { length: charLimit })
8190}
8291 </script >
8392
You can’t perform that action at this time.
0 commit comments