Socket
Socket
Sign inDemoInstall

camelcase

Package Overview
Dependencies
0
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.1 to 8.0.0

4

index.d.ts

@@ -48,3 +48,3 @@ export type Options = {

@param input - String to convert to camel case.
@param input - The string to convert to camel case.

@@ -76,3 +76,3 @@ @example

camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true}));
camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true});
//=> 'FooBAR'

@@ -79,0 +79,0 @@

@@ -45,3 +45,3 @@ const UPPERCASE = /[\p{Lu}]/u;

return input.replace(LEADING_CAPITAL, m1 => toLowerCase(m1));
return input.replaceAll(LEADING_CAPITAL, match => toLowerCase(match));
};

@@ -53,4 +53,5 @@

return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier))
.replace(NUMBERS_AND_IDENTIFIER, m => toUpperCase(m));
return input
.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ['_', '-'].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match))
.replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));
};

@@ -57,0 +58,0 @@

{
"name": "camelcase",
"version": "7.0.1",
"version": "8.0.0",
"description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`",

@@ -17,3 +17,3 @@ "license": "MIT",

"engines": {
"node": ">=14.16"
"node": ">=16"
},

@@ -44,6 +44,6 @@ "scripts": {

"devDependencies": {
"ava": "^4.3.0",
"tsd": "^0.20.0",
"xo": "^0.49.0"
"ava": "^5.3.1",
"tsd": "^0.28.1",
"xo": "^0.55.1"
}
}

@@ -41,3 +41,3 @@ # camelcase

camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true}));
camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true});
//=> 'FooBAR'

@@ -74,3 +74,3 @@

String to convert to camel case.
The string to convert to camel case.

@@ -132,14 +132,7 @@ #### options

## camelcase for enterprise
Available as part of the Tidelift Subscription.
The maintainers of camelcase and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string
- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one
- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) - Convert object keys to camel case
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc