sindresorhus

camelcase

Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar

by sindresorhus

JavaScript

JavaScript95.9%
TypeScript4.1%

Commit activity

Last 12 weeks · 6 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template
sohail-fabtech

With , a lowercase Deseret letter at the beginning of the input stays lowercase. JavaScript's native case conversion correctly uppercases the same character. The example uses U+10428, a lowercase letter represented by two UTF-16 code units. Its uppercase counterpart is U+10400. Reproduction Expected: PascalCase should uppercase the complete first Unicode character, including characters outside the Basic Multilingual Plane. Suggested fix: Read and replace the first full Unicode code point instead of uppercasing only . Version: 9.0.0. Environment: Node.js v24.19.0.

sohail-fabtech · 1w ago
leomav

In this PR Based on this issue #77 If understood correctly, what's needed is for strings' characters to change to lower case or upper case only if they are not after a number. For example: Chars after numbers do not change index.js Created a helper function called applyCasingExceptAfterNumber, which is responsible to apply case functions to all chars except the ones after a number. It takes as parameters the string, and the case function. test.js Updated 6 tests in order for the new desired effect to be the correct one package.json Update the xo dependency version in order for tests to run due to a bug presented in previous xojs/xo versions

leomav · 11mo ago
TomerAberbach

I noticed that is not idempotent, which I think is a bug. i.e. if is meant to return a camel-cased version of the input, then camel-casing it _again_ should not result in a diff because it's already been camel-cased. I've added a failing property-based test for this, but haven't figured out what the implementation bug is exactly. Feel free to merge as-is, but I may update this PR with an actual bug fix if I have time. An example of a case that fails is :

TomerAberbach · 11mo ago
Structured data for AI agents

Repository: sindresorhus/camelcase. Description: Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar Stars: 699, Forks: 104. Primary language: JavaScript. Languages: JavaScript (95.9%), TypeScript (4.1%). License: MIT. Latest release: v10.0.0 (1w ago). Open PRs: 0, open issues: 0. Last activity: 1w ago. Community health: 85%. Top contributors: sindresorhus, SamVerschueren, DanielSeehausen, Qix-, BendingBender, kevva, qw-in, rocktimsaikia, sverweij, mesaugat and others.