simc / dartx

Superpowers for Dart. Collection of useful static extension methods.
https://pub.dev/packages/dartx
Apache License 2.0
1.08k stars 88 forks source link

Feature: camel, pascal, snake, kebab and dot case styles for string #162

Open hugo-pcl opened 2 years ago

hugo-pcl commented 2 years ago

Add new case styles extension for String.

Usage

'Hello World'.camel(); // helloWorld
'Hello World'.pascal(); // HelloWorld
'Hello World'.snake(); // hello_world
'Hello World'.kebab(); // hello-world
'Hello World'.dot(); // hello.world

See tests for more examples.

codecov[bot] commented 2 years ago

Codecov Report

Merging #162 (84450ec) into master (6465f00) will decrease coverage by 0.16%. The diff coverage is 93.10%.

@@            Coverage Diff             @@
##           master     #162      +/-   ##
==========================================
- Coverage   97.83%   97.67%   -0.17%     
==========================================
  Files          13       13              
  Lines         787      816      +29     
==========================================
+ Hits          770      797      +27     
- Misses         17       19       +2     
Impacted Files Coverage Δ
lib/src/string.dart 97.89% <93.10%> (-2.11%) :arrow_down:

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

passsy commented 2 years ago

This is pretty much what https://pub.dev/packages/recase offers. And I'd love to have them provided by dartx.

I don't mind, having the functionality duplicated here. But I have some questions I personally don't yet have answers to:

👍 for better documentation than recase 😉

arthurbcd commented 4 months ago

Recase is highly used right now. https://pub.dev/packages/recase.

Let's just use the same convention that most people are used to.

Can we just export it like @passsy said?