File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/openneuro-server/src/datalad Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -58,20 +58,20 @@ export const repairDescriptionTypes = (description) => {
5858 for ( const field of arrayStringFields ) {
5959 if ( Object . hasOwn ( description , field ) ) {
6060 if ( ! isArrayOfStrings ( description [ field ] ) ) {
61- // Check if the array is corrupted with objects (DataCite flow)
61+ // Check if the array is corrupted
6262 if ( Array . isArray ( description [ field ] ) ) {
6363 newDescription [ field ] = description [ field ]
6464 . map ( ( item ) => {
6565 // If item is an object with a 'name' field (DataCite contributor), extract the name.
6666 if ( typeof item === "object" && item !== null && item . name ) {
6767 return String ( item . name )
6868 }
69- // Otherwise, attempt to stringify the item (might still produce garbage, but defensive)
69+ // Otherwise, attempt to stringify the item
7070 return String ( item )
7171 } )
72- . filter ( ( s ) => typeof s === "string" && s . trim ( ) . length > 0 ) // Keep only clean strings
72+ . filter ( ( s ) => typeof s === "string" && s . trim ( ) . length > 0 )
7373 } else {
74- // If it's not an array at all, replace with an empty array (original logic)
74+ // If it's not an array at all (original logic)
7575 newDescription [ field ] = [ ]
7676 }
7777 }
You can’t perform that action at this time.
0 commit comments