granularityParentHierarchy(granularity) { if (!this.granularityParentHierarchyCache[granularity]) { this.granularityParentHierarchyCache[granularity] = [granularity].concat( this.granularityParent(granularity) ? this.granularityParentHierarchy(this.granularityParent(granularity)) : [] ); } return this.granularityParentHierarchyCache[granularity]; }
end() { let pos = this.choices.length - this.limit; let choices = reorder(this.choices); this.choices = choices.slice(pos).concat(choices.slice(0, pos)); this.index = this.limit - 1; return this.render(); }
[ 'FETCH_TRANSFER_SUMMARY_ERROR', 'FETCH_TRANSFER_SUMMARY_SUCCESS', 'TRANSFER_SUMMARY_DIFF_CHANGE', ].concat( // Create an array of event types based on the available snapshots. Object.keys(historySnapshotTypes).reduce((accumulator, snapshotType) => { accumulator.push(`${snapshotType}_SNAPSHOT_FULL_UPDATE`, `${snapshotType}_SNAPSHOT_DIFF_CHANGE`); return accumulator; }, []), )
getAllProps() { let names = Object.getOwnPropertyNames(this.props.fun); let symbols = Object.getOwnPropertySymbols(this.props.fun); return _.sortBy(names.concat(symbols), (value) => { return value.toString(); }); }
Object.keys(strapi.plugins).reduce((acc, current) => { const isDocumentationNeeded = this.isPluginDocumentationNeeded(current); if (isDocumentationNeeded) { return acc.concat(current); } return acc; }, [])
function addNonParamAttributes(items) { var types = []; items.forEach(function(item) { types = types.concat( buildItemTypeStrings(item) ); }); return types; }
walkTaggedTemplate(node, context) { const tag = this.walk(node.tag, context); const { quasi } = node; const strings = quasi.quasis.map((q) => this.walk(q, context)); const values = quasi.expressions.map((e) => this.walk(e, context)); // eslint-disable-next-line return tag.apply(null, [strings].concat(values)); }
rollupGranularity() { if (!this.rollupGranularityValue) { this.rollupGranularityValue = this.query.cacheValue( ['rollupGranularity', this.granularity].concat(this.dateRange), () => this.query.minGranularity(this.granularity, this.dateRangeGranularity()) ); } return this.rollupGranularityValue; }
// Mimic commander syntax errors (with offsets) for consistency /* eslint-disable no-console */ const exitWithError = function () { const args = Array.prototype.slice.call(arguments); console.error(); console.error(...[" "].concat(args)); console.error(); process.exit(1); // eslint-disable-line no-process-exit }
/** * Return a service settings without protected properties. * * @param {Object?} settings */ _getPublicSettings(settings) { if (settings && Array.isArray(settings.$secureSettings)) { return _.omit(settings, [].concat(settings.$secureSettings, ["$secureSettings"])); } return settings; }
log(level, args) { // make the passed in arguments object an array with the spread operator args = this.maskSensitive([...args]); args = [].concat(level, args.map(arg => { if (typeof arg === 'function') { return arg(); } return arg; })); this.adapter.log.apply(this.adapter, args); }
patterns.forEach((pat, i) => { if (hasIgnore(pat)) { return; } ignore = ignores.concat( patterns.slice(i).filter(hasIgnore).map(p => p.slice(1)) ) globs.push({ pattern: pat, options: Object.assign(opts, { ignore }) }); });
export function convert( blob, options ) { let ranges = new Array(); options = options || {}; options.links = 'undefined' === typeof options.links ? true : options.links; ranges = ranges.concat( blob.ranges || [] ); ranges = ranges.concat( blob.media || [] ); return recurse_convert( blob.text, ranges, options ); }
// @flow // Convert an array of relative growth numbers to an array of absolute ones // [1, 2, 3, 1] => [1, 3, 6, 7] const relativeToAbsolute = (input: Array<number>): Array<number> => input.reduce( (arr, val) => { return arr.concat([arr[arr.length - 1] + val]); }, [input[0]] )
map(names = [], prop = 'value') { return [].concat(names || []).reduce((acc, name) => { acc[name] = this.find(name, prop); return acc; }, {}); }