• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript lodash.upperFirst函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript lodash.values函数代码示例发布时间:2022-05-25
下一篇:
TypeScript lodash.unset函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap