exports.fullyQualifiedName = function fullyQualifiedName(value) { if (value === null || value === undefined) { return ''; } var name = value.name; if (value.className === 'Service.RPCMethod') { name = _.capitalize(name); } if (value.hasOwnProperty('parent')) { var parent_name = fullyQualifiedName(value.parent); if (parent_name !== '') { name = parent_name + '.' + name; } } return name; };
order.forEach(function(item,index){ var search = [], title = []; for(var i = 0; i <= index; i++){ search.push('"'+order[i]+'":'+'"'+values[i]+'"'); title.push(order[i]+': '+values[i]); } output.push( <a key={'bread-'+item} href={'/portal/search?rq={'+search.join(',')+'}&view=media'} title={'SEARCH MEDIA '+title.join(', ')} >{_.capitalize(values[index])}</a> ); if((order.length-1) > index){ output.push(<span key={'arrow'+index}> > </span>); } });
.then(function(data){ deffered.resolve({ id: obj.id, measurementId: obj.measurement_id, monitorId: obj.monitor_id, upperbound: obj.upperbound, lowerbound: obj.lowerbound, sensitivity: obj.sensitivity, next_reading: obj.next_reading, repeatInterval: obj.repeat_within_seconds, oauthAvailable: !!measurementModel.oauth_id, serviceName: data ? _.capitalize(data.service_name) : null, isOutOfBound: measurementModel.isOutofBounds(), isMissed: measurementModel.isMissed(), updated_at: obj.updated_at }); })
}, function (first) { var name = this.name = this.name || first.name; var className = _.capitalize(_.camelCase(name)); var prompts = [{ name: 'className', message: 'The class name of the component', default: className, when: !this.className }]; this.prompt(prompts, function (props) { _.extend(this, props); done(); }.bind(this)); }.bind(this));
_.each(effects, stat => { const properEffect = _.capitalize(stat); const effect = require(`./effects/${properEffect}`)[properEffect]; let potencyBonus = this.caster.liveStats[stat]; if(potencyBonus < 0) potencyBonus = 0; this.cast({ damage: 0, message: '', applyEffect: effect, applyEffectName: stat, applyEffectPotency: 1 + potencyBonus, applyEffectDuration: stat === 'prone' ? 1 : this.calcDuration(), targets: [target] }); });
const Track = ({ name, data, ...props }) => ( <Root id={name} py={[3, 4]} {...props}> <Container maxWidth={32} align="center" px={3}> {name && ( <Heading.h2 color="black" fontSize={4} children={capitalize(name)} /> )} {descriptions[name] && ( <Text color="slate" fontSize={2} children={descriptions[name]} /> )} </Container> <Grid> {map(data, (edge, ii) => ( <WorkshopItem data={edge.node} key={`workshops-${name}-${ii}`} /> ))} </Grid> </Root> )
return function JobRow(props) { return ( <KuiTableRow> <KuiTableRowCell>{ props.job_id }</KuiTableRowCell> <KuiTableRowCell> <MachineLearningJobStatusIcon status={props.state} /> { capitalize(props.state) } </KuiTableRowCell> <KuiTableRowCell>{ numeral(props.data_counts.processed_record_count).format(LARGE_ABBREVIATED) }</KuiTableRowCell> <KuiTableRowCell>{ numeral(props.model_size_stats.model_bytes).format(LARGE_BYTES) }</KuiTableRowCell> <KuiTableRowCell>{ numeral(props.forecasts_stats.total).format(LARGE_ABBREVIATED) }</KuiTableRowCell> <KuiTableRowCell> { getNode(props.node) } </KuiTableRowCell> </KuiTableRow> ); };
scanDateSubmit : (formData, extraArgs, cb) => { let scanDate = _.get(formData, 'value.scanDate'); if(!scanDate) { return cb(Errors.MissingParam('"scanDate" missing from form data')); } scanDate = moment(scanDate, this.scanDateFormat); if(!scanDate.isValid()) { return cb(Errors.Invalid(`"${_.get(formData, 'value.scanDate')}" is not a valid date`)); } const targetSelection = _.get(formData, 'value.targetSelection'); // may be undefined if N/A this[`setNewScanDateFor${_.capitalize(this.target)}Base`](targetSelection, scanDate, () => { return this.prevMenu(cb); }); },
return function(tokens, idx) { var info = tokens[idx].info.trim(); bsClass = bsClass || info.toLowerCase(); title = title || _.capitalize(info); var isOpeningTag = tokens[idx].nesting === 1; if (isOpeningTag) { return ( '<div class="bs-callout bs-callout-' + bsClass + '"><h4>' + title + '</h4>\n' ); } else { return '</div>\n'; } };
tokenize.define(function(sentence, current, prev) { var words = tokenize.words()(sentence); // Is the letter uppercase? if (words.length == 0 || words[0].value[0] == words[0].value[0].toUpperCase()) return null; return { index: words[0].index, offset: words[0].offset, message: "sentence should start with an uppercase letter", replacements: [ { value: _.capitalize(words[0].value) } ] }; })
grunt.config.get('services').forEach((service) => { grunt.file.mkdir(service.outputDir); exec('pleaserun', [ '--install', '--no-install-actions', '--install-prefix', service.outputDir, '--overwrite', '--name', name, '--description', capitalize(name), '--user', user, '--group', group, '--sysv-log-path', `${path.logs}/`, '-p', service.name, '-v', service.version, path.kibanaBin ]); });
_.each(this.props.reports, (report) => { reportComponents.push( <Tr key={report.id}> <Td column="source"> {_.capitalize(report.source)} </Td> <Td column="phase"> {phaseText(report.phase)} </Td> <Td column="attendees"> {report.attendees} </Td> <Td column="sandersSupporters"> {report.sandersSupporters} </Td> <Td column="clintonSupporters"> {report.clintonSupporters} </Td> <Td column="omalleySupporters"> {report.omalleySupporters} </Td> <Td column="uncommittedSupporters"> {report.uncommittedSupporters} </Td> <Td column="sandersDelegates"> {report.sandersDelegates} </Td> <Td column="clintonDelegates"> {report.clintonDelegates} </Td> <Td column="omalleyDelegates"> {report.omalleyDelegates} </Td> <Td column="uncommittedDelegates"> {report.uncommittedDelegates} </Td> <Td column="edit"> <Link to={`${this.props.location.pathname}/reports/${report.id}`}>Edit</Link> </Td> <Td column="remove"> <Link to='#' data-id={report.id} onClick={ (e) => this.removeReport(e) }>Remove</Link> </Td> </Tr> ); });
render() { const data = this.props.data return ( <tr key={data.id} onMouseEnter={() => {this.setState({ hovered: true })}} onMouseLeave={() => {this.setState({ hovered: false })}} > <td className="collapsing"> <b>{ _.capitalize(moment(data.createdAt).format('ddd D.M')) }</b> </td> <td className="center aligned">{data.get('diastolic')} <i className=" green checkmark icon"></i></td> <td className="center aligned"> {data.get('systolic')} <i className=" green checkmark icon"></i> {this.state.hovered ? (<button onClick={() => this.props.actions.bpDelete(data.id)} className="ui blue button delete-button action-buttons ">X</button>) : '' } </td> </tr> ) }
const createNotif = (userId, quiltId, quiltTheme, messageType, contribName) => { let message; switch(messageType) { case 1: message = `You have been invited to participate in ${quiltTheme}`; break; case 2: message = `${_.capitalize(contribName)} has made a contribution to ${quiltTheme}`; break; case 3: message = `Quilt ${quiltTheme} is done!`; break; default: message = "Default message"; } // status: 0 = unread, 1 = read return db.Notification.create({ userId, quiltId, message, status: 0 }); }
_.each(categories, function(category) { var funcNames = mapping.category[_.capitalize(category)], object = require(path.join(outputPath, category)); _.each(funcNames, function(funcName) { var aliases = _.without(getAliases(funcName), 'wrapperLodash'); _.each(aliases, function(alias) { var objects = [(category == 'seq' ? lodash.prototype : lodash), object]; _.each(objects, function(object, index) { var value = (!index && alias == 'toIterator') ? object[Symbol.iterator] : object[alias]; assert.ok(_.isFunction(value), '`' + alias + '` is an alias of `' + funcName + '`'); }); }); }); });
setTimeout(function() { // Prompt Questions var question = [ { type: 'input', name: 'deleteFile', message: 'Enter ' + _.capitalize(program.delete_template) + ' Template Name To Delete(no extension):' } ]; inquirer.prompt(question).then(function(answer) { var templateName = answer.deleteFile; // Delete File deleteTemplate(fileType, templateName, directory); }); }, 100);
render() { return ( <View style={[styles.weatherMainData, {backgroundColor: '#50B6E7'}, this.props.style]}> <View style={{justifyContent: 'flex-start', flex: 1, paddingHorizontal: 10}}> {this.props.city && <Text style={styles.city}>{this.props.city}</Text> } <Text style={styles.weatherTemp}>{Math.round(this.props.data.mainData.temp)}°</Text> <Text style={styles.weatherSmallText}>{_.capitalize(this.props.data.description)}</Text> <Text style={styles.weatherSmallText}>Humidity: {this.props.data.mainData.humidity}%</Text> <Text style={styles.weatherSmallText}>Pressure: {Math.round(this.props.data.pressure)} mm Hg</Text> <Text style={styles.weatherSmallText}>Wind: {Math.round(this.props.data.wind.speed)} m/s</Text> </View> <Image source={{uri: this.props.data.image}} resizeMode='cover' style={styles.mainImage}/> </View> ) }
.map(function(code) { var i18n = _.get(self.i18n.active().featureCodes.labels, code.featurecode.name); return { hasStar: ( !_.isEmpty(code.numbers) && _.startsWith(code.numbers[0], '*') ) || ( !_.isEmpty(code.patterns) && code.patterns[0].match(/^(\^?\\\*)/) ), label: _.get(i18n, 'label', _.capitalize(code.featurecode.name)), number: _.has(code.featurecode, 'number') ? _.replace(code.featurecode.number, /\\/g, '') : '', tooltip: _.get(i18n, 'tooltip') }; })
export function removeFromIndexFile(indexFilePath, entityName, options = {}) { if (!checkFileExists(indexFilePath)) { logger.missing(indexFilePath); return; } logger.update(indexFilePath); let varName = options.capitalizeVarName ? _.capitalize(_.camelCase(entityName)) : _.camelCase(entityName); let regex = new RegExp(` ${varName}.*\n`, 'g'); let content = fs.readFileSync(indexFilePath, {encoding: 'utf-8'}); content = removeWholeLine(content, `import ${varName} from './${_.snakeCase(entityName)}';`); content = removeWholeLine(content, regex); outputFileSync(indexFilePath, content); }
var listTemplates = function(fileType, filePathToFileType) { console.log(colors.red(_.capitalize(fileType) + ' Template List:\n')); // Path to Custom Template Folder fs.readdir(filePathToFileType, function(err, items) { if (items.length <= 1) { return( console.log(' - No Templates Available.\n___________________') ); } for (var i=0; i<items.length; i++) { if (items[i] !== '.gitkeep') { console.log(' - ' + items[i]); } } console.log('___________________'); }); };
{[DEFAULT_TAB, ...tabs].map(key => { return ( <Tab onClick={() => { history.replace({ ...location, search: fromQuery({ ...toQuery(location.search), detailTab: key }) }); }} selected={currentTab === key} key={key} > {capitalize(key)} </Tab> ); })}
export const tickFormatter = (format = '0,0.[00]', template, getConfig = null) => { if (!template) template = '{{value}}'; const render = handlebars.compile(template, { knownHelpersOnly: true }); const durationFormatTest = /[pnumshdwMY]+,[pnumshdwMY]+,\d+/; let formatter; if (durationFormatTest.test(format)) { const [from, to, decimals] = format.split(','); const inputFormat = durationsLookup[from]; const outputFormat = `as${capitalize(durationsLookup[to])}`; const DurationFormat = fieldFormats.getType('duration'); formatter = new DurationFormat({ inputFormat, outputFormat, outputPrecision: decimals }); } else { let FieldFormat = fieldFormats.getType(format); if (FieldFormat) { formatter = new FieldFormat(null, getConfig); } else { FieldFormat = fieldFormats.getType('number'); formatter = new FieldFormat({ pattern: format }, getConfig); } } return (val) => { let value; if (!isNumber(val)) { value = val; } else { try { value = formatter.convert(val, 'text'); } catch (e) { value = val; } } try { return render({ value }); } catch (e) { return String(value); } }; };
createRoutes: function() { if(!this.fs.exists('www/js/modules/' + _.toLower(this.options.moduleName) + '/' + _.toLower(this.options.moduleName) + '.routes.js')) { this.log(chalk.yellow('### Creating routes ###')); var destinationPath = 'www/js/modules/' + _.toLower(this.options.moduleName) + '/' + _.toLower(this.options.moduleName) + '.routes.js'; var controllerName = _.capitalize(this.viewName) + 'Controller'; this.fs.copyTpl( this.templatePath('_routes.js'), this.destinationPath(destinationPath), { author: this.options.author, moduleName: _.toLower(this.options.moduleName), controllerName: controllerName, viewName: _.toLower(this.viewName), date: (new Date()).toDateString() } ); } else { this.requiresEditRoutes = true; } },
_.forEach(array_fields, function (field) { "use strict"; var question; if (_.isArray(field)) { question = this.getQuestions(field, default_model); } else { type = 'transform' + _.capitalize(field.type) + 'Field'; if (!Transformers[type]) { console.error(type); type = 'transformDefaultField'; } question = Transformers[type](field, _.get(default_model, field.key)); } if (question != null) { return questions.push(question); } });
getLicenseInfo() { if (this.props.license) { const licenseExpiry = () => { if (this.props.license.expiry_date_in_millis < moment().valueOf()) { // license is expired return ( <span className="monTableCell__clusterCellExpired"> Expired </span> ); } // license is fine return ( <span> Expires { moment(this.props.license.expiry_date_in_millis).format('D MMM YY') } </span> ); }; return ( <div> <div className="monTableCell__clusterCellLiscense"> { capitalize(this.props.license.type) } </div> <div className="monTableCell__clusterCellExpiration"> { showLicenseExpiration ? licenseExpiry() : null } </div> </div> ); } // there is no license! return ( <EuiLink onClick={this.handleClickInvalidLicense.bind(this)} > <EuiHealth color="subdued" data-test-subj="alertIcon"> N/A </EuiHealth> </EuiLink> ); }
const Menubar = (props) => <div className={styles.menubar}> <div className={styles.budget}> Budget <strong>{format({prefix: '$'})(props.budget, {integerSeparator: true})}</strong> </div> <div className={styles.notification}> {props.buffer ? <span> <strong> {_.capitalize(props.buffer)} {`$${_.find(Tools, {name: props.buffer}).price}`} </strong> <span> Place item on desk to purchase</span> </span> : null} {props.deleteMode ? <strong>Click tool to delete</strong> : null} </div> </div>
getComponentsByType = type => { const items = _(this.getComponentsByQuery()) .filter(component => META.isType(component, type)) .sortBy((component, name) => name) .map(component => { const name = component._meta.name return <Menu.Item key={name} name={name} href={`#${name}`} /> }) .value() const subMenu = ( <div className='item'> <div className='header'>{_.capitalize(type)}s</div> <div className='menu'>{items}</div> </div> ) return items && subMenu };
// apply the defaults to individual options _applyOptDefault(opt = {}) { const optLabel = opt.label ? opt.label : capitalize(opt.key); const defaultedOpt = { label: optLabel, hasFunction: !!opt.run, description: opt.run ? optLabel : i18n.translate('common.ui.topNav.toggleViewAriaLabel', { defaultMessage: 'Toggle {optLabel} view', values: { optLabel } }), run: (item) => this.toggle(item.key), ...opt }; defaultedOpt.hideButton = isFunction(opt.hideButton) ? opt.hideButton : () => !!opt.hideButton; defaultedOpt.disableButton = isFunction(opt.disableButton) ? opt.disableButton : () => !!opt.disableButton; defaultedOpt.tooltip = isFunction(opt.tooltip) ? opt.tooltip : () => opt.tooltip; return defaultedOpt; }
value: function (shareObject) { var self = this, populatedSharePromise; if (!shareObject.properties) { var shareTypes = this.constructor.SHARE_TYPES; shareObject.properties = {}; shareObject.properties["%type"] = 'Share' + _.capitalize(shareObject.type); populatedSharePromise = this.shareRepository.getNewUnixPermissions().then(function(unixPermissions) { if (shareTypes.SMB === shareObject.type) { shareObject.properties.vfs_objects = []; shareObject.properties.browseable = true; shareObject.properties.hosts_allow = []; shareObject.properties.hosts_deny = []; shareObject.properties.previous_versions = true; } else if (shareTypes.NFS === shareObject.type) { shareObject.properties.hosts = []; shareObject.properties.security = []; } else if (shareTypes.ISCSI === shareObject.type) { shareObject.properties.block_size = 512; shareObject.properties.size = 0; shareObject.__extent = { id: null, lun: 0 }; } else if (shareTypes.AFP === shareObject.type) { shareObject.properties.afp3_privileges = true; shareObject.properties.default_file_perms = _.defaultsDeep(_.cloneDeep(unixPermissions), self.constructor.DEFAULT_FILE_PERMISSIONS); shareObject.properties.default_directory_perms = _.defaultsDeep(_.cloneDeep(unixPermissions), self.constructor.DEFAULT_DIRECTORY_PERMISSIONS); shareObject.properties.default_umask = _.cloneDeep(unixPermissions); } return shareObject; }); } else { populatedSharePromise = Promise.resolve(shareObject); } return populatedSharePromise.then(function(populatedShareObject) { return self.ensureDefaultPermissionsAreSet(populatedShareObject); }); }
render() { return ( <div className="productItem"> <div className="section"> <h2>{_.capitalize(this.state.project)}</h2> </div> <div className={"section" + (this.state.okPressed === SIDE.LEFT ? " active" : "")}> <label>Stanga</label> <button className="ui button green huge" disabled={this.state.okPressed === SIDE.LEFT} onClick={this.setOk.bind(this, SIDE.LEFT)}> Ok </button> <button className="ui button red huge" onClick={this.setNotOk.bind(this, SIDE.LEFT)}> Defect </button> </div> <div className={"section" + (this.state.okPressed === SIDE.RIGHT ? " active" : "")}> <label>Dreapta</label> <button className="ui button green huge" disabled={this.state.okPressed === SIDE.RIGHT} onClick={this.setOk.bind(this, SIDE.RIGHT)}> Ok </button> <button className="ui button red huge" onClick={this.setNotOk.bind(this, SIDE.RIGHT)}> Defect </button> </div> <Selector ref="errorSelector" options={this.props.defects} label="name" onOk={this.setDefect.bind(this)}> </Selector> </div> ); }