function path_to_chunks(
    path,
    ignore_trailing_slash = false,
    sys_root_prefix = '_sys_root'
) {
    // Handle relative scenario
    if (path === './') return ['.', ''];

    // Remove trailing slash
    if (path.endsWith('/') && !ignore_trailing_slash)
        path = path.substr(0, path.length - 1);

    // Add a relative lead path for absolute initial path scenarios
    if (!path.startsWith('./') && !path.startsWith('/')) path = './' + path;
    let chunks = path.split('/');

    // Convert empty lead value to system root prefix
    if (chunks[0].length == 0) chunks[0] = sys_root_prefix;
    return chunks;
}
/**
 * This method breaks down a path into array based hierarchy strings.
 *
 * @param {String} path Path value for decoupling
 * @param {String} sys_root_prefix System root prefix for empty value representation
 * @returns {Array} Array
 */
This method breaks down a path into array based hierarchy strings.
@param {String} path Path value for decoupling
@param {String} sys_root_prefix System root prefix for empty value representation
@returns {Array} Array
This method breaks down a path into array based hierarchy strings . @param { String } path Path value for decoupling @param { String } sys_root_prefix System root prefix for empty value representation @returns { Array } Array
function path_to_chunks(
    path,
    ignore_trailing_slash = false,
    sys_root_prefix = '_sys_root'
) {
    if (path === './') return ['.', ''];
    if (path.endsWith('/') && !ignore_trailing_slash)
        path = path.substr(0, path.length - 1);
    if (!path.startsWith('./') && !path.startsWith('/')) path = './' + path;
    let chunks = path.split('/');
    if (chunks[0].length == 0) chunks[0] = sys_root_prefix;
    return chunks;
}
function path_to_chunks ( path , ignore_trailing_slash = false , sys_root_prefix = '_sys_root' ) { if ( path === './' ) return [ '.' , '' ] ; if ( path . endsWith ( '/' ) && ! ignore_trailing_slash ) path = path . substr ( 0 , path . length - 1 ) ; if ( ! path . startsWith ( './' ) && ! path . startsWith ( '/' ) ) path = './' + path ; let chunks = path . split ( '/' ) ; if ( chunks [ 0 ] . length == 0 ) chunks [ 0 ] = sys_root_prefix ; return chunks ; }
This method breaks down a path into array based hierarchy strings.
This method breaks down a path into array based hierarchy strings .
// Handle relative scenario // Remove trailing slash // Add a relative lead path for absolute initial path scenarios // Convert empty lead value to system root prefix