_(process.env) // Only muck with prefix_ variables .pickBy((value, key) => _.includes(key, prefix)) // Prep the keys for consumption .mapKeys((value, key) => _.camelCase(_.trimStart(key, prefix))) // If we have a JSON string as a value, parse that and assign its sub-keys .mapValues(exports.tryConvertJson) // Resolve the lodash wrapper .value()
title = _.camelCase(title); title = _.upperFirst(title); title = title.replace(/I18N/, 'I18n');
/** * Converts a string to its camel-cased version. */ Handlebars.registerHelper('camelCase', (str) => { return _.camelCase(str); });
/** * Constructor for receipt * * @param {string} id Id * @param {object} results Results */ constructor(id, results) { this.properties = Object.assign({}, DEFAULT_PROPERTIES); this.properties.id = id; for (let i in results) { this.properties[_.camelCase(i)] = results[i]; } }
const ReassignmentStatement = ({ originalImportPath, packagedArguments }) => { const { isTypescript } = packagedArguments; if (!isTypescript) return ''; const identifier = _.camelCase(originalImportPath); const newIdentifier = `${identifier}Original`; return `const ${identifier} = ${newIdentifier} as any`; }
_.forEach(commandsByTopic, function(commands, topic){ var sfdxTopic = sfdxApi[topic] = {}; _.forEach(commands, function(command){ sfdxTopic[_.camelCase(command.command)] = _createCommand(command.run); }) });
get(name) { name = _.upperFirst(_.camelCase(name)); if(this.models[name]) return this.models[name]; try { this.models[name] = require(`models/${_.snakeCase(name)}`); } catch(e) { throw e; } return this.models[name]; }
const getBodyModelNameInCamelCase = operation => { const { bodyModel, parameters } = operation; let bodyModelName = bodyModel; if (bodyModel === 'string') { const bodyParam = parameters.find(param => param.in === 'body'); if (bodyParam) { bodyModelName = bodyParam.name; } } return _.camelCase(bodyModelName); }
const getConfigForEventType = (eventType, protocolVersion) => { const camelEventType = _.camelCase(eventType); const startBlockKey = `startBlock.${camelEventType}.v${protocolVersion}`; const startBlock = config.get(startBlockKey); const maxChunkSize = config.get('maxChunkSize'); const minConfirmations = config.get('minConfirmations'); if (startBlock === undefined) { throw new Error( `Start block config not found for v${protocolVersion} ${eventType} events`, ); } return { startBlock, maxChunkSize, minConfirmations }; }
getRawCoreInfo(i, function (rawCoreInfo) { rawCoreInfo.forEach(function (rawInfo) { var info = rawInfo.split(':'); var key = _.camelCase(_.trim(_.first(info))); var value = _.trim(_.last(info)); coreInfo[key] = value; }); });
toFastcallName(typeName) { return _.upperFirst(_.camelCase(typeName)) .replace('Uint', 'UInt') .replace('Longlong', 'LongLong'); }
/** * Go through all the keys in the given object—included the keys of any nested objects—and * return a new object that has them them all converted from PascalCase to camelCase (i.e., * don't capitalize the first letter). We need this primarily because Step Functions requires * PascalCase for its configuration, but when we pass parts of that configuration directly to * AWS APIs, some of those APIs require camelCase. * * @param obj */ function pascalCaseToCamelCase(obj) { return deepMapKeys(obj, (value, key) => _.camelCase(key)); }
const SpecialImportStatement = ({ importPath, originalImportPath, packagedArguments }) => { const identifier = _.camelCase(originalImportPath); const { isTypescript } = packagedArguments; if (!isTypescript) { return DefaultImportStatement({ importPath, identifier, packagedArguments }); } const newIdentifier = `${identifier}Original`; const importStatement = DefaultImportStatement({ importPath, identifier: newIdentifier, packagedArguments, }); return importStatement; }
_.forOwn(config, (value, key) => { config[_.camelCase(key)] = config[key]; });
const getConfigForEventType = (eventType, protocolVersion) => { const camelEventType = _.camelCase(eventType); const startBlockKey = `startBlock.${camelEventType}.v${protocolVersion}`; const startBlock = config.get(startBlockKey); const maxChunkSize = config.get('maxChunkSize'); const minConfirmations = config.get('minConfirmations'); if (startBlock === undefined) { throw new Error( `Start block config not found for v${protocolVersion} ${eventType} events`, ); } return { startBlock, maxChunkSize, minConfirmations }; }