New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

changetotitlecase

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

changetotitlecase - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

test.js

18

index.js
"use strict"
let titleCase = (str)=>{
let titleCase = (str, restToLowerCase=false)=>{
let strArray =str.split( " ");
let retStr = "";
if(restToLowerCase === true){
strArray.forEach(word=>{
if(word !== ""){
let concatWord = `${word.charAt(0).toUpperCase()}${word.substr(1).toLowerCase()} `
retStr= retStr.concat(concatWord);
}
})
}else{
strArray.forEach(word=>{
if(word !== ""){
let concatWord = `${word.charAt(0).toUpperCase()}${word.substr(1).toLowerCase()} `
let concatWord = `${word.charAt(0).toUpperCase()}${word.substr(1)} `
retStr= retStr.concat(concatWord);

@@ -14,2 +25,5 @@

})
}

@@ -16,0 +30,0 @@ return retStr.trim();

2

package.json
{
"name": "changetotitlecase",
"version": "1.0.0",
"version": "2.0.0",
"description": "Coverts the string to title case for ex:- I am good\" it converst to I Am Good",

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

@@ -1,4 +0,4 @@

# changetotitlecase
# titlecase
This javascript node module for conversion of string in to title case
For example :- 'i am good looking' to 'I Am Good Looking'
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