resources/js/EditDataset.js
/*
* Recursively merge properties of two objects 
*/
Recursively merge properties of two objects
Recursively merge properties of two objects
realMerge(from, dbObject) {
        for (var prop in dbObject) {
            try {
                if (typeof dbObject[prop] !== 'object') {
                    from[prop] = dbObject[prop];
                } else if (this.isObject(dbObject[prop])) {
                    from[prop] = this.realMerge(from[prop], dbObject[prop]);
                }
                else if (this.isObject(dbObject[prop]) || this.isObject(from[prop])) {
                    from[prop] = from[prop];
                }
                else if (Array.isArray(dbObject[prop])) {
                    from[prop] = dbObject[prop];
                }
                else {
                    from[prop] = null;
                }
            } catch (e) {
                from[prop] = dbObject[prop];
            }
        }
        if (from.embargo_date) {
            from.embargo_date = this.formatDateFormat(new Date(from.embargo_date), 'yyyy-MM-dd');
        }
        return from;
    }
realMerge ( from , dbObject ) { for ( var prop in dbObject ) { try { if ( typeof dbObject [ prop ] !== 'object' ) { from [ prop ] = dbObject [ prop ] ; } else if ( this . isObject ( dbObject [ prop ] ) ) { from [ prop ] = this . realMerge ( from [ prop ] , dbObject [ prop ] ) ; } else if ( this . isObject ( dbObject [ prop ] ) || this . isObject ( from [ prop ] ) ) { from [ prop ] = from [ prop ] ; } else if ( Array . isArray ( dbObject [ prop ] ) ) { from [ prop ] = dbObject [ prop ] ; } else { from [ prop ] = null ; } } catch ( e ) { from [ prop ] = dbObject [ prop ] ; } } if ( from . embargo_date ) { from . embargo_date = this . formatDateFormat ( new Date ( from . embargo_date ) , 'yyyy-MM-dd' ) ; } return from ; }
Recursively merge properties of two objects
Recursively merge properties of two objects
// coverage relation if null from dbObject // Property in destination object not set; create it and set its value.