@@ -375,24 +375,24 @@ function findFileUrls(schema: any, _entry: any, assetUrls: any) {
375375}
376376
377377function updateFileFields (
378- objekt : any ,
378+ object : any ,
379379 parent : any ,
380380 pos : any ,
381381 mappedAssetUids : any ,
382382 matchedUids : any ,
383383 unmatchedUids : any ,
384384 mappedAssetUrls ?: any ,
385385) {
386- if ( _ . isPlainObject ( objekt ) && _ . has ( objekt , 'filename' ) && _ . has ( objekt , 'uid' ) ) {
386+ if ( _ . isPlainObject ( object ) && _ . has ( object , 'filename' ) && _ . has ( object , 'uid' ) ) {
387387 if ( typeof pos !== 'undefined' ) {
388388 if ( typeof pos === 'number' || typeof pos === 'string' ) {
389389 const replacer = ( ) => {
390- if ( mappedAssetUids . hasOwnProperty ( objekt . uid ) ) {
391- parent [ pos ] = mappedAssetUids [ objekt . uid ] ;
392- matchedUids . push ( objekt . uid ) ;
390+ if ( mappedAssetUids . hasOwnProperty ( object . uid ) ) {
391+ parent [ pos ] = mappedAssetUids [ object . uid ] ;
392+ matchedUids . push ( object . uid ) ;
393393 } else {
394394 parent [ pos ] = '' ;
395- unmatchedUids . push ( objekt . uid ) ;
395+ unmatchedUids . push ( object . uid ) ;
396396 }
397397 } ;
398398
@@ -401,7 +401,7 @@ function updateFileFields(
401401 }
402402
403403 if (
404- objekt &&
404+ object &&
405405 _ . isObject ( parent [ pos ] ) &&
406406 parent [ pos ] . uid &&
407407 parent [ pos ] . url &&
@@ -417,24 +417,24 @@ function updateFileFields(
417417 parent = _ . omit ( parent , [ 'asset' ] ) ;
418418 }
419419
420- if ( objekt . uid && mappedAssetUids && mappedAssetUids [ objekt . uid ] ) {
421- objekt . uid = mappedAssetUids [ objekt . uid ] ;
420+ if ( object . uid && mappedAssetUids && mappedAssetUids [ object . uid ] ) {
421+ object . uid = mappedAssetUids [ object . uid ] ;
422422 }
423- if ( objekt . url && mappedAssetUrls && mappedAssetUrls [ objekt . url ] ) {
424- objekt . url = mappedAssetUrls [ objekt . url ] ;
423+ if ( object . url && mappedAssetUrls && mappedAssetUrls [ object . url ] ) {
424+ object . url = mappedAssetUrls [ object . url ] ;
425425 }
426426 } else {
427427 replacer ( ) ;
428428 }
429429 }
430430 }
431- } else if ( _ . isPlainObject ( objekt ) ) {
432- for ( let key in objekt ) updateFileFields ( objekt [ key ] , objekt , key , mappedAssetUids , matchedUids , unmatchedUids ) ;
433- } else if ( _ . isArray ( objekt ) && objekt . length ) {
434- for ( let i = 0 ; i <= objekt . length ; i ++ )
435- updateFileFields ( objekt [ i ] , objekt , i , mappedAssetUids , matchedUids , unmatchedUids ) ;
431+ } else if ( _ . isPlainObject ( object ) ) {
432+ for ( let key in object ) updateFileFields ( object [ key ] , object , key , mappedAssetUids , matchedUids , unmatchedUids ) ;
433+ } else if ( _ . isArray ( object ) && object . length ) {
434+ for ( let i = 0 ; i <= object . length ; i ++ )
435+ updateFileFields ( object [ i ] , object , i , mappedAssetUids , matchedUids , unmatchedUids ) ;
436436
437437 // No need for _.compact() since you want to keep zero values
438- parent [ pos ] = _ . filter ( objekt , ( value : any ) => value !== undefined && value !== null ) ;
438+ parent [ pos ] = _ . filter ( object , ( value : any ) => value !== undefined && value !== null ) ;
439439 }
440440}
0 commit comments