lib/config-loader.js
function walk(configDirectory, resourceName, resources) {
    resourceName = resourceName || '';
    resources = resources || {};

    fs.readdirSync(path.join(configDirectory, resourceName)).forEach(fileName => {
        const subResourceName = (resourceName !== '' ? resourceName + '/' : '') + fileName;
        const absoluteFilePath = path.join(configDirectory, subResourceName);
        const stat = fs.statSync(absoluteFilePath);
        if (stat && stat.isDirectory()) {
            walk(configDirectory, subResourceName, resources);
        } else if (resourceName !== '') {
            if (fileName.startsWith('config.')) {
                if (!resources[resourceName]) resources[resourceName] = {};
                resources[resourceName].configFile = absoluteFilePath;
            }
            if (fileName === 'index.js') {
                if (!resources[resourceName]) resources[resourceName] = {};
                resources[resourceName].instanceFile = absoluteFilePath;
            }
        }
    });

    return resources;
}
function walk(configDirectory, resourceName, resources) {
    resourceName = resourceName || '';
    resources = resources || {};

    fs.readdirSync(path.join(configDirectory, resourceName)).forEach(fileName => {
        const subResourceName = (resourceName !== '' ? resourceName + '/' : '') + fileName;
        const absoluteFilePath = path.join(configDirectory, subResourceName);
        const stat = fs.statSync(absoluteFilePath);
        if (stat && stat.isDirectory()) {
            walk(configDirectory, subResourceName, resources);
        } else if (resourceName !== '') {
            if (fileName.startsWith('config.')) {
                if (!resources[resourceName]) resources[resourceName] = {};
                resources[resourceName].configFile = absoluteFilePath;
            }
            if (fileName === 'index.js') {
                if (!resources[resourceName]) resources[resourceName] = {};
                resources[resourceName].instanceFile = absoluteFilePath;
            }
        }
    });

    return resources;
}
function walk ( configDirectory , resourceName , resources ) { resourceName = resourceName || '' ; resources = resources || { } ; fs . readdirSync ( path . join ( configDirectory , resourceName ) ) . forEach ( fileName => { const subResourceName = ( resourceName !== '' ? resourceName + '/' : '' ) + fileName ; const absoluteFilePath = path . join ( configDirectory , subResourceName ) ; const stat = fs . statSync ( absoluteFilePath ) ; if ( stat && stat . isDirectory ( ) ) { walk ( configDirectory , subResourceName , resources ) ; } else if ( resourceName !== '' ) { if ( fileName . startsWith ( 'config.' ) ) { if ( ! resources [ resourceName ] ) resources [ resourceName ] = { } ; resources [ resourceName ] . configFile = absoluteFilePath ; } if ( fileName === 'index.js' ) { if ( ! resources [ resourceName ] ) resources [ resourceName ] = { } ; resources [ resourceName ] . instanceFile = absoluteFilePath ; } } } ) ; return resources ; }
Read config files from directory recursively.

@param {string} configDirectory
@param {string} resourceName
@param {object} resources
@return {Array}
@private
Read config files from directory recursively .