Socket
Socket
Sign inDemoInstall

title-case

Package Overview
Dependencies
3
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.0

13

package.json
{
"name": "title-case",
"version": "1.0.1",
"version": "1.1.0",
"description": "Title case a string",
"main": "title-case.js",
"files": [
"title-case.js",
"LICENSE"
],
"scripts": {

@@ -29,8 +33,9 @@ "test": "istanbul cover _mocha -- -R spec"

"istanbul": "^0.3.0",
"mocha": "^1.18.2"
"mocha": "^1.18.2",
"pre-commit": "0.0.9"
},
"dependencies": {
"sentence-case": "^1.0.2",
"upper-case": "^1.0.0"
"sentence-case": "^1.1.1",
"upper-case": "^1.0.3"
}
}

@@ -6,6 +6,7 @@ # Title Case

[![Test coverage][coveralls-image]][coveralls-url]
[![Gittip][gittip-image]][gittip-url]
Title case a string.
Supports Unicode (non-ASCII characters) and non-string entities, such as objects with a `toString` property, numbers and booleans. Empty values (`null` and `undefined`) will result in an empty string.
## Installation

@@ -24,2 +25,4 @@

titleCase('PascalCase'); //=> "Pascal Case"
titleCase('STRING', 'tr'); //=> "Strıng"
```

@@ -37,3 +40,1 @@

[coveralls-url]: https://coveralls.io/r/blakeembrey/title-case?branch=master
[gittip-image]: https://img.shields.io/gittip/blakeembrey.svg?style=flat
[gittip-url]: https://www.gittip.com/blakeembrey

@@ -1,3 +0,3 @@

var upper = require('upper-case');
var sentence = require('sentence-case');
var upperCase = require('upper-case');
var sentenceCase = require('sentence-case');

@@ -8,6 +8,9 @@ /**

* @param {String} string
* @param {String} [locale]
* @return {String}
*/
module.exports = function (string) {
return sentence(string).replace(/^\w| \w/g, upper);
module.exports = function (str, locale) {
return sentenceCase(str, locale).replace(/^.| ./g, function (m) {
return upperCase(m, locale);
});
};
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc