iqfareez / recase

Recase with my modification

Repository from Github https://github.comiqfareez/recaseRepository from Github https://github.comiqfareez/recase

ReCase

My changes

  • Optimize Title Case
    • Roman character UPPERCASE
    • Reserved keywords UPPERCASE
    • English preposition lowercase
    • Fix issue where character after parenthesis is not capitalized in Title Case

Contributing

  1. Fork this repository.
  2. Open file lib/recase.dart.
  3. Modify the entry in _englishSpecialTerm function. The list contains English prepositions that should be lowercase all the time, except when it is located at the beginning of a sentence.
  4. Or, modify the words in _reservedWords function. It is the phrase that has always been capitalized. Eg: IT.
  5. romanNumerals. Roman numerals. I guess no need to add too many numbers in this entry. However, if it is needede, feel free to do so.
  6. Use online tools like https://convertcase.net/ to verify the Title Case.
  7. Run test in test/recase_test.dart (Only the Title Case group).
  8. Open a PR for your fixes.

Changes the case of the input text to the desire case convention.

import 'package:recase/recase.dart';

void main() {
  ReCase rc = new ReCase('Just_someSample-text');

  print(rc.camelCase); // Prints 'justSomeSampleText'
  print(rc.constantCase); // Prints 'JUST_SOME_SAMPLE_TEXT'
}

String extensions are also available.

import 'package:recase/recase.dart';

void main() {
  String sample = 'Just_someSample-text';

  print(sample.camelCase); // Prints 'justSomeSampleText'
  print(sample.constantCase); // Prints 'JUST_SOME_SAMPLE_TEXT'
}

This feature is available in version 3.0.0, and requires at least Dart 2.6

Supports:

  • snake_case
  • dot.case
  • path/case
  • param-case
  • PascalCase
  • Header-Case
  • Title Case
  • camelCase
  • Sentence case
  • CONSTANT_CASE

About

Recase with my modification

License:BSD 2-Clause "Simplified" License


Languages

Language:Dart 100.0%