Questions tagged [kebab-case]

12 questions
671
votes
15 answers

What's the name for hyphen-separated case?

This is PascalCase: SomeSymbol This is camelCase: someSymbol This is snake_case: some_symbol So my questions is whether there is a widely accepted name for this: some-symbol? It's commonly used in url's.
lmirosevic
  • 15,787
  • 13
  • 70
  • 116
29
votes
5 answers

Convert kebab-case to camelCase with JavaScript

Say I have a function that transforms kebab-case to camelCase: camelize("my-kebab-string") === 'myKebabString'; I'm almost there, but my code outputs the first letter with uppercase too: function camelize(str){ let arr = str.split('-'); let…
Robert Hovhannisyan
  • 2,938
  • 6
  • 21
  • 43
14
votes
7 answers

How do I covert kebab-case into PascalCase?

How could I convert this to PascalCase and to camelCase? var text = "welcome-to-a-New-day"; toPascalCase(text); // "WelcomeToANewDAY" toCamelCase(text); // "WelcomeToANewDAY"
1
vote
0 answers

OpenAPI Generator for Java RestTemplate - Change field name case strategy

The OpenAPI Generator for RestTemplate currently produces entity models that have @JsonProperty on getters and setters that use camelCase. There doesn't seem to be a configuration option to customise this to use other cases like snake or kebab case.…
ystan-
  • 1,474
  • 1
  • 19
  • 43
1
vote
1 answer

how to find out what case style a string is (pascal, snake, kebab, camel)

I want to write a program that outputs whether a string is styled in pascal case, camel case, snake case, kebab case, or none of them. in the first line, we should take integer n from input. then, in the next n lines, we should take an integer k and…
Fateme
  • 41
  • 4
1
vote
4 answers

Convert kebab-case to camelCase

I'm looking for a simple return inside a method that converts any use of kebab-case and turns it into camelCase. For example: hello-world Becomes helloWorld I'm trying to use .replaceAll() but I can't seem to get it right!
Venom
  • 11
  • 1
  • 3
0
votes
0 answers

How to structure folders in nextJs 13

1st Question: I saw some people that they are creating components folder inside a page folder **Example 1: src/ app/ gallery/ components page.tsx** On the other hand, I preferred this structure **Example 2: src/ …
0
votes
1 answer

Can kebab case have upper case letters as first letter?

Is there a strict definition for kabab case naming convention? Are uppercase letters allowed in kebab case? Does the following names follow kebab case? Article Article-Body
golopot
  • 10,726
  • 6
  • 37
  • 51
0
votes
0 answers

How to convert nested JSON payload from Kebab case into Camel Case using javascript

I need to convert the kebab case into camel case. The depth of the JSON object can be up to 5 child elements. I tried to implement it (see here), but the output is not the expected. Input: { "is-success": true, "response-date":…
Diya
  • 43
  • 1
  • 9
0
votes
1 answer

Kebab-case rust modules

I like naming my folders and files by the kebab-case convention. Recently, I've been learning rust and learned a bit about modules. In one of the examples, I have a file named: distinct-powers.rs. Whenever I do mod distinct-powers to put the code in…
justbecause
  • 189
  • 2
  • 9
0
votes
3 answers

In React, what case should a CSS property name beginning with -webkit be converted to?

E.g. -webkit-text-fill-color Using '-webkit-text-fill-color': 'red' got me an error "Using kebab-case for css properties in objects is not supported. Did you mean WebkitTextFillColor?" Have tried WebkitTextFillColor, webkitTextFillColor, and…
dixylo
  • 58
  • 6
0
votes
2 answers

How can I use kebab-case for naming components in Vue?

I'd like to use snake_case on the names of components when I call its name on the tag within the template. I just tried: