orderBy() { if (R.isEmpty(this.order)) { return ''; } const orderByString = R.pipe( R.map(this.orderHashToString), R.reject(R.isNil), R.join(', ') )(this.order); if (!orderByString) { return ''; } return ` ORDER BY ${orderByString}`; }
queriesForContext(contextId) { // return All queries if no context pass if (R.isNil(contextId) || R.isEmpty(contextId)) { return this.queries; } const context = this.contextEvaluator.contextDefinitions[contextId]; // If contextId is wrong if (R.isNil(context)) { throw new UserError(`Context ${contextId} doesn't exist`); } // As for now context works on the cubes level return R.filter( (query) => R.contains(query.config.name, context.contextMembers) )(this.queries); }
const PersonalCard = ({ profile, editingOpen }) => ( !isEmpty(profile) ? <CardMolecule> <PersonalInfo onClick={editingOpen}> <h1>{profile.name + ' ' + profile.lastName}</h1> <h2>{profile.nickName}</h2> </PersonalInfo> <AvatarWrapper> <Avatar src={profile.avatar} title={profile.name}/> </AvatarWrapper> </CardMolecule> : null )
build() { const content = { type: this.type, payload: this._getPayload() } if (isEmpty(this.quickReplies)) return content return merge(content, {quick_replies: this.quickReplies}) }
/** * Is this value a blank string? * * @param value The value to check. * @returns True if it was, otherwise false. */ function isBlank(value: any): boolean { return isNotString(value) || isEmpty(trim(value)) }
const removeEmptyFields = function(obj) { return Object.keys(obj).reduce((acc, field) => { if ( R.compose( R.not, R.either(R.isNil, R.isEmpty) )(obj[field]) ) { acc[field] = obj[field]; } return acc; }, {}); }
function removeEmpty(as: Array<string>): Array<string> { return as.filter(a => R.not(R.isEmpty(a))) }
PROJECTS.map(project => { const additionalProjectConfig = require(additionalConfigPath)(project); commonConfig.plugins.push( new webpack.DefinePlugin({ 'process.env': { NODE_ENV: `'${process.env.NODE_ENV}'`, }, __PROJECT__: project, __DEVELOPMENT__: process.env.NODE_ENV === 'development', __TEST__: process.env.NODE_ENV === 'test', __PRODUCTION__: process.env.NODE_ENV === 'production', __CLIENT__: true, }) ); if (process.env.NODE_ENV === 'development') { resultConfig = merge.smart( additionalProjectConfig, !R.isEmpty(resultConfig) ? resultConfig : commonConfig ); } else { resultConfig.push(merge(additionalProjectConfig, commonConfig)); } });
_verifyXHub(req) { const xHubSignature = req.header('X-Hub-Signature') const webhook = req.body const channelId = path(['data', 'channel', 'id'], webhook) if (!channelId) { return 'Failed to verify X-Hub-Signature. Couldn\'t find "webhook.data.channel.id".' } if (!this.secrets || isEmpty(this.secrets)){ throw new Error('Define at least 1 secret.') } const secret = this.secrets[channelId] if (!secret) { return `Failed to verify X-Hub-Signature. Channel with id "${channelId}" is missing webhook secret.` } if (!req.rawBody) { return `Failed to verify X-Hub-Signature. req.rawBody doesn't exist. It is attached using body-parser: app.use(bodyParser.json({ verify: attachRawBody }))`; } const rawWebhook = Buffer.from(req.rawBody).toString('utf8') if (!xHubSignatureUtils.verifyXHubSignature(xHubSignature, rawWebhook, secret)) { return `Failed to verify X-Hub-Signature for "channel.id" ${channelId}` } }
const addTag = tag => (R.isEmpty(tag) ? '' : ':' + tag)
render() { const { isFetching, apps } = this.props return ( <Apps> {!isEmpty(apps) && apps.map((app) => <AppCard key={keyify(app.name)} app={app} currentColorPicker={this.state.currentColorPicker} handleClick={this.handleClick} handleClose={this.handleClose} changeColor={this.changeColor} openEditingModal={this.editingModalOpen} /> )} <Modal closeable={true} title={'Edit App'} isOpen={this.state.isEditing} onClose={this.editingModalClose}> <EditCardContainer modalClose={this.editingModalClose} cardId={this.state.editingAppId}/> </Modal> </Apps> ) }
loadManyItems(keys: any[]): Promise<V[]> { const targetKeys = R.filter((item) => !R.isEmpty(item) && !R.isNil(item), (keys || [])); return this.loadMany(targetKeys); }
if (config.DRY_RUN || R.isEmpty(imageTagsToDelete)) { resolve({ failures: [],
if (!scriptCmd || R.isEmpty(scriptCmd)) { throw new Error( `Could not resolve script named "${options.scriptName}" on ${pkg.name}`,
); if (isEmpty(user)) { return ( <div className="section-wrapper">