/** * Index test. */ "use strict"; module.exports = { mode: '444', force: true, data: { moduleName: 'apemanUtil', get indices() { var lib = require('../../lib'); function names(module, name, depth) { depth = (depth || 0) + 1; if (depth > 5) { return null; } var shouldIgnore = ['core', 'ext', 'schemas'].indexOf(name.split('.').pop()) !== -1; if (shouldIgnore) { return []; } switch (typeof(module)) { case 'string': case 'function': return [name]; default: break; } return [ name ].concat( Object.keys(module) .map(function (key) { return names(module[key], [name, key].join('.'), depth); }) ) . reduce(function (result, current) { return result.concat(current); }, []) } return names(lib, 'apemanUtil', 0).filter(function (index) { return !!index; }); } } };