function flat(arr, res) { let i = 0; const len = arr.length; for (; i < len; i++) { const cur = arr[i]; Array.isArray(cur) ? flat(cur, res) : res.push(cur); } return res; }
async process() { try { let issues = await Promise.all(this.repositories.map(async repository => await this.getIssues(repository))); issues = issues.filter(issueArray => issueArray.length > 0).flat().flat(); const groupedIssues = this.groupIssues(issues); const bot = new BotService(this.context); await bot.sendData(groupedIssues); } catch ({ message }) { this.context.error(message) } }
function nested(first, rest) { const o = Object.create(notPromise) o.first = first o.rest = rest.flat() return o }
useMemo(() => { return Object.values(conditions).flat().length > 0; }, [conditions])
const flatten = (array, depth) => { const flattend = []; (function flat(array, depth) { for (const el of array) { if (Array.isArray(el) && depth > 0) { flat(el, depth - 1); } else { flattend.push(el); } } })(array, Math.floor(depth) || 1); return flattend; }
const getEffectiveTreeAsList = ( root ) => { const tree = generateEffectiveTree( root ); function print( branch, prefix = [] ) { return ( Object.entries( branch ) // Ensure deps are listed in alphabetical order .sort( ( a, b ) => a[ 0 ].localeCompare( b[ 0 ] ) ) // For each dep, create a new array with the dep name + all its deps recursively .map( ( [ depName, nestedDependencies ] ) => { const newPrefix = [ ...prefix, depName ]; if ( nestedDependencies === '[Circular]' ) { return [ [ ...newPrefix, nestedDependencies ] ]; } return [ newPrefix, ...print( nestedDependencies, newPrefix ) ]; } ) .flat() ); } return print( tree ) .map( ( line ) => line.join( ' ' ) ) .join( '\n' ); }
})) } else { const flatContent = flat(content) Object.keys(flatContent).forEach(key => { const val = flatContent[key]
/** * @typedef {Object} EmbedFieldData * @property {StringResolvable} name The name of this field * @property {StringResolvable} value The value of this field * @property {boolean} [inline] If this field will be displayed inline */ /** * Normalizes field input and resolves strings. * @param {...EmbedFieldData|EmbedFieldData[]} fields Fields to normalize * @returns {EmbedField[]} */ static normalizeFields(...fields) { return fields .flat(2) .map(field => this.normalizeField( field && field.name, field && field.value, field && typeof field.inline === 'boolean' ? field.inline : false, ), ); }
return Object.values(categoryConditions).flat().length > 0; }, [categoryConditions]);
function flat(arr, res) { let i = 0; const len = arr.length; for (; i < len; i++) { const cur = arr[i]; Array.isArray(cur) ? flat(cur, res) : res.push(cur); } return res; }
const flatten = (array, depth) => { const flattend = []; (function flat(array, depth) { for (const el of array) { if (Array.isArray(el) && depth > 0) { flat(el, depth - 1); } else { flattend.push(el); } } })(array, Math.floor(depth) || 1); return flattend; }
useMemo(() => { return Object.values(conditions).flat().length > 0; }, [conditions])
return Object.values(categoryConditions).flat().length > 0; }, [categoryConditions]);
return Object.values(categoryConditions).flat().length > 0; }, [categoryConditions]);
return Object.values(categoryConditions).flat().length > 0; }, [categoryConditions]);