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

capitalize

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capitalize - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

.prettierrc.yml

2

index.js

@@ -12,5 +12,5 @@ module.exports = function (string, preserve) {

}
return string.replace(/(^|[^a-zA-Z\u00C0-\u017F\u0400-\u04FF'])([a-zA-Z\u00C0-\u017F\u0400-\u04FF])/g, function (m) {
return string.replace(/(?!^[0-9])(^|[^a-zA-Z\u00C0-\u017F\u0400-\u04FF'])([a-zA-Z\u00C0-\u017F\u0400-\u04FF])/g, function (m) {
return m.toUpperCase()
})
}
{
"name": "capitalize",
"version": "2.0.2",
"version": "2.0.3",
"description": "capitalize the first letter of a string, or all words in a string",

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

@@ -1,2 +0,2 @@

# capitalize
# capitalize ![Build](https://github.com/grncdr/js-capitalize/workflows/Node%20CI/badge.svg)

@@ -34,3 +34,3 @@ Capitalize the first letter of a string, or all words in a string.

t.plan(2)
t.test('...in upper case', function (t1) {

@@ -40,3 +40,3 @@ t1.plan(1)

})
t.test('...in mixed case', function (t2) {

@@ -46,3 +46,3 @@ t2.plan(1)

})
})

@@ -52,3 +52,3 @@

t.plan(2)
t.test('...in upper case', function (t1) {

@@ -58,3 +58,3 @@ t1.plan(1)

})
t.test('...in mixed case', function (t2) {

@@ -64,3 +64,3 @@ t2.plan(1)

})
})

@@ -110,3 +110,12 @@ ```

and thanks to [@rubengmurray](https://github.com/grncdr/js-capitalize/pull/13), capitalize now handles shorthand ordinal numbers as would be expected:
```javascript
test('Capitalize words, handling shorthand ordinals (1st, 2nd, 3rd) correctly', function (t) {
t.plan(1)
t.equal(capitalize.words('1st place'), '1st Place')
})
```
## Install

@@ -113,0 +122,0 @@

Sorry, the diff of this file is not supported yet

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