How to use the capitalize.words 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 assetgraph / assetgraph / lib / util / fonts / getTextByFontProperties.js View on Github external
const props = {};
          for (const prop of CSS_PROPS_TO_TRACE_AND_TEXT) {
            props[prop] = hypotheticalValueByProp[prop].value;
          }
          // Apply text-transform:
          const textTransform = props['text-transform'];
          if (
            textTransform !== 'none' &&
            !hypotheticalValueByProp.text.isListIndicator
          ) {
            if (textTransform === 'uppercase') {
              props.text = props.text.toUpperCase();
            } else if (textTransform === 'lowercase') {
              props.text = props.text.toLowerCase();
            } else if (textTransform === 'capitalize') {
              props.text = capitalize.words(props.text);
            }
          }
          return props;
        })
        .filter(function filterAndDeduplicate(textWithProps) {
github foundation / octophant / lib / processSassDoc.js View on Github external
for (var i in sass) {
    if (sass[i].length === 0) delete sass[i];
  }

  // Get a list of all groups
  groupList = Object.keys(sass);

  // Sort groups by user-defined categories
  for (var i in sort) {
    var index = groupList.indexOf(sort[i]);
    groupList = move(groupList, index, 0);
  }

  // Finally, build a new object with the sorted groups
  for (var i in groupList) {
    var group = groups[groupList[i]] || capitalize.words(groupList[i].replace('-', ' '));
    sassSorted[group] = sass[groupList[i]];
  }

  return sassSorted;
}
github Wildhoney / ReactShadow / example / js / weather.js View on Github external
        const description = () => capitalise.words(nlp.noun(weather.weather[0].description).pluralize());
github ritz078 / starring / lib / select-some-packages.js View on Github external
return packageDetails.map(x => {
				return ({
					name: `${colors.green.bold(x.name)}${x.author ? ` by ${colors.blue(capitalize.words(x.author))}` : ''}`,
					value: x
				});
			});
		}
github benji6 / andromeda / src / components / pages / KeyboardSettings.js View on Github external
        instrument => ({text: capitalize.words(instrument), value: instrument}),
        controllableInstrumentInstanceNames(plugins)
github reacat / reacat / src / generate.jsx View on Github external
this.markdownFiles.forEach((markdownFile) => {
    let relative = path.relative(path.resolve(this.cwd, this.config.source_dir), markdownFile.filePath);
    if (!markdownFile.frontMatter.layout) {
      markdownFile.frontMatter.layout = 'index';
    }
    if (!markdownFile.frontMatter.title) {
      let title = markdownFile.filePath;
      title = path.basename(title, path.extname(title));
      title = capitalize.words(title.replace(/[-_]/g, ' '));
      markdownFile.frontMatter.title = title;
    }
    if (!markdownFile.frontMatter.permalink) {
      let permalink = path.join('/', path.dirname(relative), path.basename(relative, path.extname(relative)));
      markdownFile.frontMatter.permalink = permalink;
    }
    if (!markdownFile.frontMatter.date) {
      const fileStat = fs.statSync(markdownFile.filePath);
      let date = moment(fileStat.birthtime).format(this.config.date_format);
      markdownFile.frontMatter.date = date;
    } else {
      markdownFile.frontMatter.date = moment(markdownFile.frontMatter.date).format(this.config.date_format);
    }
  });
  log.verbose('mergeFrontMatters', JSON.stringify(this.markdownFiles, null, 2));
github benji6 / andromeda / client / components / molecules / ArpeggiatorSelector.js View on Github external
                  options={map(value => ({text: capitalize.words(value),
                                          value}), patterns)} />
github Nike-Inc / referee / packages / client / src / components / docs / TableOfContentsNav.tsx View on Github external
({ tocEntry, history, path }: { tocEntry: TableOfContentsEntry; history: H.History; path: string }): JSX.Element => {
    return (
      <div>
        <div>{capitalize.words(tocEntry.directory.replace(/-/g, ' '))}</div>
        {tocEntry.pages.map((page: PageEntry) =&gt; {
          return (
            <div path=""> {
                docsService.fetchAndUpdateDocContent(`${tocEntry.directory}/${page.filename}`);
                history.push(`/docs/${tocEntry.directory}/${page.filename}`);
                window.scrollTo(0, 0);
              }}
            &gt;
              {Optional.ofNullable(page.display_name).orElse(capitalize.words(page.filename.replace(/-/g, ' ')))}
            </div></div>
github Wildhoney / ReactShadow / example / js / components / country.js View on Github external
        const description = () => capitalise.words(weather.weather[0].description);
github benji6 / andromeda / src / components / pages / PatternSettings.js View on Github external
        instr => ({text: capitalize.words(instr), value: instr}),
        controllableInstrumentInstanceNames(plugins)

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