lib/util/index.js
function getLeafOfPath(obj, path, create_object = true) {
    const parts = Array.isArray(path) ? path.slice(0) : path.split('.');
    const last = parts.pop();
    if (parts.length > 0) {
        if (create_object !== false) {
            for (const part of parts) {
                obj = obj[part] || (obj[part] = {});
            }
        }
        else {
            for (const part of parts) {
                obj = obj[part];
                if (!obj) {
                    return [undefined, undefined];
                }
            }
        }
    }
    return [obj, last];
}
function getLeafOfPath(obj, path, create_object = true) {
    const parts = Array.isArray(path) ? path.slice(0) : path.split('.');
    const last = parts.pop();
    if (parts.length > 0) {
        if (create_object !== false) {
            for (const part of parts) {
                obj = obj[part] || (obj[part] = {});
            }
        }
        else {
            for (const part of parts) {
                obj = obj[part];
                if (!obj) {
                    return [undefined, undefined];
                }
            }
        }
    }
    return [obj, last];
}
function getLeafOfPath ( obj , path , create_object = true ) { const parts = Array . isArray ( path ) ? path . slice ( 0 ) : path . split ( '.' ) ; const last = parts . pop ( ) ; if ( parts . length > 0 ) { if ( create_object !== false ) { for ( const part of parts ) { obj = obj [ part ] || ( obj [ part ] = { } ) ; } } else { for ( const part of parts ) { obj = obj [ part ] ; if ( ! obj ) { return [ undefined , undefined ] ; } } } } return [ obj , last ] ; }
Returns leaf object and last part.

e.g.) (obj, 'a.b.c') -> [ obj.a.b, 'c' ]
@memberOf util
 tslint:disable-next-line:max-line-length
Returns leaf object and last part .