How to use the capitalize function in capitalize

To help you get started, we’ve selected a few capitalize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github luqin / react-component-tools / src / index.js View on Github external
function prepareConfig(_config) {
  const pkg = readPackageJSON();
  const name = capitalize(camelCase(_config.component.pkgName || pkg.name));

  let config = defaults(_config, { alias: pkg.alias });

  // component
  config.component = defaults(config.component, {
    entry: './src/index.js',
    pkgName: pkg.name,
    name: name,
    dependencies: pkg.deps,
    src: './src',
    lib: './lib',
    dist: './dist',
  });

  config.bump = config.bump || {};
  config.bump = defaults(config.bump, {
github olymp / olymp / src2 / cms / views / collections / list.js View on Github external
const columns = fields.map((meta) => {
      const { name, description } = meta;

      return {
        title: description && description.indexOf('title:') !== -1 ? description.split('title:')[1].split('\n')[0] : capitalize(name),
        dataIndex: name,
        key: name,
        ...columnHelper(meta, items)
      }
    });
github kiwicom / orbit-components / config / build.js View on Github external
const names = files.map(inputFileName => {
  const baseName = path.basename(inputFileName).replace(/( \(custom\))?\.svg$/, "");
  const functionName = capitalize(camelcase(baseName));
  const outputComponentFileName = `${functionName}.js`;

  return {
    inputFileName,
    outputComponentFileName,
    functionName,
    baseName,
  };
});
github benji6 / andromeda / src / plugins / instruments / Prometheus / components / ModuleFilter.js View on Github external
Object.keys(typesToParams).map(type => createElement('option', {
      key: type,
      value: type,
    }, capitalize(type)))
    ),
github Nike-Inc / referee / packages / client / src / components / reports / canary / MetricGroup.tsx View on Github external
render(): React.ReactNode {
    const groupScore = this.props.groupScoreByMetricGroupNameMap[this.props.metricGroupName].score;
    const humanReadableScore = Number(groupScore.toFixed(2));
    const scoreLabel = capitalize(getGroupClassFromScore(groupScore, this.props.thresholds));
    const { metricGroupName } = this.props;

    return (
      <div>
        <div>
          {/*<div>Name: {metricGroupName}</div>*/}
          {/*<div>Score: {humanReadableScore}</div>*/}
          {/*<div>Label: {scoreLabel}</div>*/}
        </div>
        <div>
          {this.props.idListByMetricGroupNameMap[this.props.metricGroupName].map(id =&gt; {
            const canaryAnalysisResult: CanaryAnalysisResult = this.props.canaryAnalysisResultByIdMap[id];
            const metricName = canaryAnalysisResult.name;
            const metricSetPair: MetricSetPair = this.props.metricSetPairsByIdMap[id];
            const canaryMetricConfig: CanaryMetricConfig = ofNullable(
              this.props.canaryConfig.metrics.find(canaryMetricConfig =&gt; canaryMetricConfig.name === metricName)</div></div>
github benji6 / andromeda / client / scripts / components / molecules / InstrumentSelector.js View on Github external
{map(item =&gt;
        <option value="{item}">
          {capitalize(item)}
        </option>, instruments)}
github StormFireGame / game / src / components / hero / inventory / Items.js View on Github external
].map((item) => {
      const label = capitalize(item.replace('Give', ''));
      return renderItem(label, thing[item] > 0 ? `+${thing[item]}` : null);
    });
github react-icons / react-icons / docs / components / IconPack.js View on Github external
render() {
        const { pack, prefix } = this.props;
        const prefixUp = capitalize(prefix);
        const iconPackName = <strong>{prefixUp}IconPack</strong>
        return (
            <div>
                <h1> {pack.name} </h1>
                <h4> {pack.attribution} </h4>
                <code>import {iconPackName} from 'react-icons/lib/{prefix}'</code>
                <div>
                    {Object.keys(pack.icons).map((iconName, index) =&gt; {
                        let Icon = pack.icons[iconName];
                        let realIconName = decamelize(iconName.replace(new RegExp('^'+prefixUp), ''), '-')
                        return (
                            <div>
                                
                                <div>{iconName}</div>
                                <div style="{{fontSize:">
                                    <code>{`react-icons/lib/${prefix}/${realIconName}`}</code></div></div></div></div>
github ryardley / indexr / lib / modules / cli / extendedHelp.js View on Github external
const getTitleFromFlags = (flags) => {
  const optionLong = flags.match(/--[a-z0-9-_]+/)[0];
  const optionLower = optionLong.replace('--', '').replace('-', ' ');
  return capitalize(optionLower);
};

capitalize

capitalize the first letter of a string, or all words in a string

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular capitalize functions