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 2.0.1 to 2.1.0

21

index.js
'use strict';
function preserveCamelCase(str) {
var isLastCharLower = false;
for (var i = 0; i < str.length; i++) {
var c = str.charAt(i);
if (isLastCharLower && c.toUpperCase() === c) {
str = str.substr(0, i) + '-' + str.substr(i);
isLastCharLower = false;
i++;
} else {
isLastCharLower = (c.toLowerCase() === c);
}
}
return str;
}
module.exports = function () {

@@ -29,2 +48,4 @@ var str = [].map.call(arguments, function (str) {

str = preserveCamelCase(str);
return str

@@ -31,0 +52,0 @@ .replace(/^[_.\- ]+/, '')

2

package.json
{
"name": "camelcase",
"version": "2.0.1",
"version": "2.1.0",
"description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",

@@ -5,0 +5,0 @@ "license": "MIT",

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