/** Adds a single clause to the queryBuilder @method addClause @private @param {String} action The action to add to the query @param {Array} args The arguments to the queryBuilder action @param {Boolean} isOr Whether this action should be the 'or' version of itself */ addClause (action, args, isOr) { if (isOr) action = 'or' + capitalize(action) this.queryBuilder = this.queryBuilder[action](...args) }
async function main() { const keys = Object.keys(source); Promise.each(locales, async (locale) => { const language = getLanguage(locale); const output = await Promise.reduce(keys, async (result, key) => { const value = source[key]; const [translated] = await translate.translate(value, language); result[key] = capitalize(translated); return result; }, {}); fs.outputJson(`./i18n/messages/${locale}.json`, output, { spaces: 2 }); }) }
const getNotPokedKills = async (kills = []) => ( new Promise(async (resolve, reject) => { try { const queryMeta = await Meta.findOne(); const { lastCheck } = queryMeta; const lastCheckMoment = moment(lastCheck); const killsToPoke = kills.map(({ type, name, killedBy, timeAgo }) => { const isNewKill = lastCheckMoment.isSameOrAfter(moment(timeAgo)); if (isNewKill) return `${capitalize(type)} ${capitalize(name)} Killed ${killedBy}`; return ''; }); resolve(killsToPoke); } catch (error) { reject(error); } }) )
const updatedSectionLink = { destination: name, label: capitalize(pluralize(name)), };
header = <FormattedMessage id={`users-permissions.PopUpForm.header.${actionType}.${settingType}`} values={{ provider: <i>{capitalize(dataToEdit)}</i> }} />;
<FormattedMessage id="users-permissions.Plugin.permissions.plugins.description" values={{ name: capitalize(this.props.name) }} /> )}
let model = config.models[capitalize(paramName)]
{message => ( <span style={{ fontStyle: 'italic' }}> {capitalize(this.props.row.params.target)} {this.props.row.params.pluginValue ? `(${message}: ${this.props.row.params.pluginValue})`
leftMenuContentTypes[0].links.push({ destination: newContentType, label: capitalize(pluralize(newContentType)) }); leftMenuContentTypes[0].links = sortBy(leftMenuContentTypes[0].links, 'label'); action.context.updatePlugin('content-manager', 'leftMenuSections', leftMenuContentTypes);
<ListGroupItem key={_id}> <Checkbox name="role" value={name} defaultChecked={inRole} inline> {capitalize(name)} </Checkbox> </ListGroupItem>