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.1.0 to 1.1.1

12

index.js

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

*/
function handleSpecialWords(str) {
function handleSpecialWords(str, index) {
const lowercaseStr = str.toLowerCase();
const uppercaseStr = str.toUpperCase();
for (let i = 0; i < specialCase.length; i += 1) {
if (specialCase[i].toLowerCase() === lowercaseStr) return specialCase[i];
}
if (index === 0) return str;
if (prepositions.includes(lowercaseStr)) return lowercaseStr;

@@ -24,6 +30,2 @@ if (conjunctions.includes(lowercaseStr)) return lowercaseStr;

for (let i = 0; i < specialCase.length; i += 1) {
if (specialCase[i].toLowerCase() === lowercaseStr) return specialCase[i];
}
return str;

@@ -30,0 +32,0 @@ }

{
"name": "@directus/format-title",
"version": "1.1.0",
"version": "1.1.1",
"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",

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