Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@directus/format-title

Package Overview
Dependencies
Maintainers
3
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@directus/format-title - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

4

index.js

@@ -51,6 +51,6 @@ const decamelize = require('decamelize');

*
* const prettyName = formatName(safeName);
* const prettyName = formatTitle(safeName);
* // => 'Comment Metadata'
*/
module.exports = function formatName(title, separator = /\s|-|_/g) {
module.exports = function formatTitle(title, separator = /\s|-|_/g) {
return decamelize(title)

@@ -57,0 +57,0 @@ .split(separator)

{
"name": "@directus/format-title",
"version": "1.0.0",
"version": "1.1.0",
"description": "Custom string formatter that converts any string into [Title Case](http://www.grammar-monster.com/lessons/capital_letters_title_case.htm)",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,3 +11,6 @@ # format-title

| `brighton_on_sea` | Brighton on Sea |
| `apple_releases_new_ipad` | Apple Releases New iPad |
> Bonus: the package also handles specially-cased words such as iPad, PDFs, or McDonalds
## Installation

@@ -28,4 +31,7 @@ ```bash

You can provide an optional `separator` regex as a second parameter to support splitting the string on different characters. By default, this regex is set to `/\s|-|_/g`.
You can provide an optional `separator` regex as a second parameter to support splitting the string on different characters. By default, this regex is set to `/\s|-|_/g`.
## Contributing
If your favorite specially cased word isn't being capitalized properly, [please open an issue](https://github.com/rijkvanzanten/special-case/issues/new) or submit a pull request on [the repo that contains those words](https://github.com/rijkvanzanten/special-case)!
## License

@@ -32,0 +38,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc