Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
capital-case
Advanced tools
The capital-case npm package is used to convert strings into capital case where the first letter of each word is capitalized and spaces are preserved between words. It is particularly useful for formatting text to be more readable or to adhere to stylistic guidelines where capital case is required.
Convert string to capital case
This feature allows you to convert any lowercase or mixed case string into capital case, where each word starts with a capital letter and all other letters are lower case.
const { capitalCase } = require('capital-case');
const result = capitalCase('string to convert');
console.log(result); // 'String To Convert'
The title-case package also converts strings to a title format similar to capital-case. However, title-case is more focused on adhering to title capitalization rules in English, which can involve more complex rules about which words to capitalize in titles and headings.
This package is a comprehensive string transformation library that includes functions for various case transformations including capital case, lower case, upper case, and more. It offers more versatility compared to capital-case, which is specialized for capital case conversion only.
Transform into a space separated string with each word capitalized.
npm install capital-case --save
import { capitalCase } from "capital-case";
capitalCase("string"); //=> "String"
capitalCase("dot.case"); //=> "Dot Case"
capitalCase("PascalCase"); //=> "Pascal Case"
capitalCase("version 1.2.10"); //=> "Version 1 2 10"
The function also accepts options
.
MIT
FAQs
Transform into a space separated string with each word capitalized
We found that capital-case demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.