/** * Determines if the given line is a quote header * @param {string} text the text to check * @returns {boolean} true if the line is a quote header * @private */ _isQuoteHeader(text) { return filter(this._quoteHeadersRegex, exp => exp.test(esrever.reverse(text))).length > 0; }
/** * Gets a string that represents the visible text of this Email * @returns {string} the visible text */ getVisibleText() { var visibleFragments = filter(this._fragments, f => !f.isHidden()); var fragmentBodies = map(visibleFragments, f => f.getContent()); return fragmentBodies.join("\n"); }
createSelector( (state, cardId) => state.cards, (_, cardId) => cardId, (cardsState = {}, cardId = null) => { return filter(cardsState.cardErrors, { cardId }) } )
data.genres.map(genre => ({ label: genre.name, value: filter(movies, movie => movie.genre_ids && movie.genre_ids.includes(genre.id)).length, }))
const cond = (...args) => { const conds = filter(args, ({ rule }) => rule); const fallback = find(args, ({ rule }) => !rule); return obj => { const found = find(conds, ({ rule }) => run(rule, obj)) || fallback; if (found) { return found.func(obj); } }; }
export default function shouldComponentUpdate(nextProps, nextState) { if (nextProps === this.props && nextState === this.state) { return false; } if (!isEqualState(this.state, nextState)) { return true; } let impNextProps = filter(nextProps, isNotIgnorable); var currentProps = filter(this.props, isNotIgnorable); if (!isEqualProps(currentProps, impNextProps)) { return true; } return false; }
this.setState({ [target]: filter(this.state[target], (cur) => (cur !== element)) });
function isState(s) { const isUpperCase = c => upperCase(c) === c; return filter(s, isUpperCase).length === 2; }
function collectionFilteredByIds(cards, cardIds, reverse = false) { return filter(cards, (card) => { return reverse ? !includes(cardIds, card.id) : includes(cardIds, card.id) }) }
filter(this.props.menuData[0].items, (contentType) => contentType.name === data.name)
articles(user) { return filter(articles, { user_id: user.id }) }
pages(parent, { slug }) { if (typeof slug === 'String') { return filter(pages, { slug: slug }); } return pages; }
const cond = (...args) => { const conds = filter(args, ({rule}) => rule) const fallback = find(args, ({rule}) => !rule) return obj => { const found = find(conds, ({rule}) => run(rule, obj)) || fallback if (found) { return found.func(obj) } } }
transactions(item) { return filter(transactions, { itemId: item.id }); }
const filterOutSoundById = soundIdToFilter => filter(sound => sound.id !== soundIdToFilter)