当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript lodash.upperFirst函数代码示例

本文整理汇总了TypeScript中lodash.upperFirst函数的典型用法代码示例。如果您正苦于以下问题:TypeScript upperFirst函数的具体用法?TypeScript upperFirst怎么用?TypeScript upperFirst使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了upperFirst函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getAST

export const addModuleToState = (pathToAppActions: string, moduleName: string): void => {
  try {
    let file = fs.readFileSync(pathToAppActions, 'utf-8');

    getAST(file);

    file = insertAt(
      file,
      findAstNodes(sourceFile, ts.SyntaxKind.ObjectLiteralExpression, true).pop().end + 1,
      `\n  ${lowerFirst(moduleName)}: {\n    ...${upperFirst(moduleName)}DefaultState,\n  },`,
    );

    const interfaces: ts.Node[] = findAstNodes(sourceFile, ts.SyntaxKind.InterfaceDeclaration, true);

    file = insertAt(
      file,
      interfaces.shift().end - 2,
      `\n  ${lowerFirst(moduleName)}?: I${upperFirst(moduleName)}State;`,
    );

    file = insertAt(
      file,
      findAstNodes(sourceFile, ts.SyntaxKind.ImportDeclaration, true).pop().end,
      `\nimport { ${upperFirst(moduleName)}DefaultState, I${upperFirst(moduleName)}State }         from './${lowerFirst(moduleName)}/state';`,
    );

    fs.writeFileSync(pathToAppActions, file, { encoding: 'utf-8' });
  } catch (e) {
    throw new Error(e);
  }
};
开发者ID:trungx,项目名称:vue-starter,代码行数:31,代码来源:ast.ts

示例2: init

(async function init() {
  for (const commandPath of commandsPath) {
    const className = upperFirst(camelCase(commandPath.replace(/\./g, '-')));

    if (
      process.env.NODE_ENV !== 'production' &&
      filter &&
      `${filter}.command` !== commandPath
    ) {
      continue;
    }

    const classInterface = (await import(`./commands/${commandPath}`))[
      className
    ];

    const commandObject = new classInterface();
    try {
      yargs.command(commandObject);
    } catch (e) {
      console.log('ERROR ON COMMAND');
      console.log(e);
    }
  }

  yargs
    .demandCommand(1)
    .strict()
    .help('h')
    .alias('v', 'version').argv;
})();
开发者ID:pierophp,项目名称:pinyin,代码行数:31,代码来源:console.ts

示例3: upperFirst

      .map((response:any) => {
        var result = response.json(),
            name = result.name;

        result.img = 'http://img.pokemondb.net/artwork/' + name + '.jpg';
        result.name = upperFirst(name);

        cache.pokemon.set(id, result);
        return result;
      });
开发者ID:WebAppsAndFrameworks,项目名称:ng2-app,代码行数:10,代码来源:pokemon.service.ts

示例4: welcomeOAuth

	public async welcomeOAuth(requestState: RequestState, user: UserDocument): Promise<SentMessageInfo> {
		const strategyNames: { [key: string]: string } = {
			github: 'GitHub',
			google: 'Google',
			gameex: 'GameEx',
		};
		return this.sendEmail(requestState, user, 'Welcome to VPDB!', 'welcome-oauth', {
			user,
			profileUrl: settings.webUri('/profile/settings'),
			strategy: strategyNames[user.provider] || upperFirst(user.provider),
		});
	}
开发者ID:freezy,项目名称:node-vpdb,代码行数:12,代码来源:mailer.ts

示例5: constructor

    constructor(private config: IComponentGenConfig) {
        const className = upperFirst(camelCase(config.name));
        let path = `${Vesta.directories.components}/${config.path}`;
        mkdir(path);
        if (this.config.hasStyle) {
            genSass(className, path);
        }

        if (config.model) {
            path = `${path}/${className}`;
        }
    }
开发者ID:VestaRayanAfzar,项目名称:vesta,代码行数:12,代码来源:ComponentGen.ts

示例6: addProperty

 addProperty(layoutElements: {}[], property: {}, name: string, path: string) {
     if (property['type'] == 'object') {
         let sublayout: {} = {
             'type': 'Group',
             'label': _.upperFirst(name),
             'elements': []
         };
         _.forEach(property['properties'], (subproperty: any, subname: string) => {
             this.addProperty(sublayout['elements'], subproperty, subname, path + name + '/properties/');
         });
         layoutElements.push(sublayout);
     } else {
         let control: {} = {
             'type': 'Control',
             'label': _.upperFirst(name),
             'scope': {
                 '$ref': path + name
             }
         };
         layoutElements.push(control);
     }
 }
开发者ID:eclipsesource,项目名称:jsonforms-swagger,代码行数:22,代码来源:query-uischema-generator.service.ts

示例7: validate

 public validate(
   _pipeline: IPipeline,
   stage: IStage | ITrigger,
   validationConfig: IServiceFieldValidatorConfig,
 ): string {
   const serviceInput: ICloudFoundryServiceManifestSource = get(stage, 'manifest');
   if (sourceType(serviceInput, get(stage, 'userProvided')) !== validationConfig.manifestSource) {
     return null;
   }
   const manifestSource: any = get(serviceInput, sourceStruct(serviceInput));
   const content: any = get(manifestSource, validationConfig.fieldName);
   const fieldLabel = validationConfig.fieldLabel || upperFirst(validationConfig.fieldName);
   return content ? null : `<strong>${fieldLabel}</strong> is a required field for the Deploy Service stage.`;
 }
开发者ID:emjburns,项目名称:deck,代码行数:14,代码来源:cloudfoundryDeployServiceStage.module.ts

示例8:

    return this.$q.all(promises).then(results => {
      let status = 'success';
      let message = '';

      for (let i = 0; i < results.length; i++) {
        if (results[i].status !== 'success') {
          status = results[i].status;
        }
        message += `${i + 1}. ${results[i].message} `;
      }

      return {
        status: status,
        message: message,
        title: _.upperFirst(status),
      };
    });
开发者ID:CorpGlory,项目名称:grafana,代码行数:17,代码来源:datasource.ts


注:本文中的lodash.upperFirst函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。