Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extras v0.41.0 #427

Merged
merged 1 commit into from
Aug 27, 2023
Merged

extras v0.41.0 #427

merged 1 commit into from
Aug 27, 2023

Conversation

kevin-lee
Copy link
Owner

extras v0.41.0

0.41.0 - 2023-08-27

New Features

  • Add extras-string module (Add extras-string #406)

  • [extras-string] Add syntax for Int and add toOrdinal ([extras-string] Add syntax for Int and add toOrdinal #408)

    1.toOrdinal
    // String = 1st
    2.toOrdinal
    // String = 2nd
    3.toOrdinal
    // String = 3rd
    4.toOrdinal
    // String = 4th
    ...
    (1 to 30).map(_.toOrdinal).foreach(println(_))
    1st
    2nd
    3rd
    4th
    5th
    6th
    7th
    8th
    9th
    10th
    11th
    12th
    13th
    14th
    15th
    16th
    17th
    18th
    19th
    20th
    21st
    22nd
    23rd
    24th
    25th
    26th
    27th
    28th
    29th
    30th
    
  • [extras-string] Add syntax for Long and add toOrdinal ([extras-string] Add syntax for Long and add toOrdinal #409)

    1L.toOrdinal
    // String = 1st
    2L.toOrdinal
    // String = 2nd
    3L.toOrdinal
    // String = 3rd
    4L.toOrdinal
    // String = 4th
    ...
    (1L to 30L).map(_.toOrdinal).foreach(println(_))
    1st
    2nd
    3rd
    4th
    5th
    6th
    7th
    8th
    9th
    10th
    11th
    12th
    13th
    14th
    15th
    16th
    17th
    18th
    19th
    20th
    21st
    22nd
    23rd
    24th
    25th
    26th
    27th
    28th
    29th
    30th
    
  • [extras-string] Add commaWith syntax for Seq[String] ([extras-string] Add commaWith syntax for Seq[String] #419)

    An extension method for a Seq[String], providing a way to join the elements with a comma and a given conjunction.

    It joins String values with commas and uses the given conjunction before the last element.

    List.empty[String].commaWith("BLAH")
    // String = ""
    
    List("").commaWith("BLAH")
    // String = ""
    
    List("aaa").commaWith("BLAH")
    // String = "aaa"
    
    List("aaa", "bbb").commaWith("BLAH")
    // String = "aaa BLAH bbb"
    
    List("aaa", "bbb", "ccc").commaWith("BLAH")
    // String = "aaa, bbb BLAH ccc"
    
    List("aaa", "bbb", "ccc", "ddd").commaWith("BLAH")
    // String = "aaa, bbb, ccc BLAH ddd"
    
  • [extras-string] Add serialCommaWith syntax for Seq[String] ([extras-string] Add serialCommaWith syntax for Seq[String] #420)

    An extension method for a Seq[String], providing a way to join the elements with a serial comma and a given conjunction.

    It joins String values with commas and uses the given conjunction before the last element.

    This method employs the serial comma (also known as the Oxford comma),
    which means it always inserts a comma before the conjunction unless there are only two elements.

    List.empty[String].serialCommaWith("BLAH")
    // String = ""
    
    List("").serialCommaWith("BLAH")
    // String = ""
    
    List("aaa").serialCommaWith("BLAH")
    // String = "aaa"
    
    List("aaa", "bbb").serialCommaWith("BLAH")
    // String = "aaa BLAH bbb"
    
    List("aaa", "bbb", "ccc").serialCommaWith("BLAH")
    // String = "aaa, bbb, BLAH ccc"
    
    List("aaa", "bbb", "ccc", "ddd").serialCommaWith("BLAH")
    // String = "aaa, bbb, ccc, BLAH ddd"
    
  • [extras-string] Add commaAnd syntax for Seq[String] ([extras-string] Add commaAnd syntax for Seq[String] #412)

    Format Seq[String] into a human-readable list using comma and the conjunction and.
    It separates elements by commas and uses the term and before the last element.

    List.empty[String].commaAnd
    // String = ""
    
    List("").commaAnd
    // String = ""
    
    List("aaa").commaAnd
    // String = "aaa"
    
    List("aaa", "bbb").commaAnd
    // String = "aaa and bbb"
    
    List("aaa", "bbb", "ccc").commaAnd
    // String = "aaa, bbb and ccc"
    
    List("aaa", "bbb", "ccc", "ddd").commaAnd
    // String = "aaa, bbb, ccc and ddd"
  • [extras-string] Add serialCommaAnd syntax for Seq[String] ([extras-string] Add serialCommaAnd syntax for Seq[String] #414)

    Format Seq[String] into a human-readable list using comma and the conjunction and.

    It separates elements by commas and uses the term and before the last element following the "Oxford comma" style.

    e.g.) "aaa, bbb, and ccc"

    List.empty[String].serialCommaAnd
    // String = ""
    
    List("").serialCommaAnd
    // String = ""
    
    List("aaa").serialCommaAnd
    // String = "aaa"
    
    List("aaa", "bbb").serialCommaAnd
    // String = "aaa and bbb"
    
    List("aaa", "bbb", "ccc").serialCommaAnd
    // String = "aaa, bbb, and ccc"
    
    List("aaa", "bbb", "ccc", "ddd").serialCommaAnd
    // String = "aaa, bbb, ccc, and ddd"
  • [extras-string] Add commaOr syntax for Seq[String] ([extras-string] Add commaOr syntax for Seq[String] #416)

    Format Seq[String] into a human-readable list using comma and the conjunction or.

    It separates elements by commas and uses the term or before the last element.

    List.empty[String].commaOr
    // String = ""
    
    List("").commaOr
    // String = ""
    
    List("aaa").commaOr
    // String = "aaa"
    
    List("aaa", "bbb").commaOr
    // String = "aaa or bbb"
    
    List("aaa", "bbb", "ccc").commaOr
    // String = "aaa, bbb or ccc"
    
    List("aaa", "bbb", "ccc", "ddd").commaOr
    // String = "aaa, bbb, ccc or ddd"
  • [extras-string] Add serialCommaOr syntax for Seq[String] ([extras-string] Add serialCommaOr syntax for Seq[String] #417)

    Format Seq[String] into a human-readable list using comma and the conjunction or.

    It separates elements by commas and uses the term or before the last element following the "Oxford comma" style.

    e.g.) "aaa, bbb, or ccc"

    List.empty[String].serialCommaOr
    // String = ""
    
    List("").serialCommaOr
    // String = ""
    
    List("aaa").serialCommaOr
    // String = "aaa"
    
    List("aaa", "bbb").serialCommaOr
    // String = "aaa or bbb"
    
    List("aaa", "bbb", "ccc").serialCommaOr
    // String = "aaa, bbb, or ccc"
    
    List("aaa", "bbb", "ccc", "ddd").serialCommaOr
    // String = "aaa, bbb, ccc, or ddd"

@kevin-lee kevin-lee added this to the milestone42 milestone Aug 27, 2023
@kevin-lee kevin-lee self-assigned this Aug 27, 2023
@github-actions github-actions bot added pr release Release labels Aug 27, 2023
@codecov
Copy link

codecov bot commented Aug 27, 2023

Codecov Report

Merging #427 (ea8fbde) into main (f59f917) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #427   +/-   ##
=======================================
  Coverage   89.98%   89.98%           
=======================================
  Files          43       43           
  Lines         649      649           
  Branches       51       51           
=======================================
  Hits          584      584           
  Misses         65       65           

@kevin-lee kevin-lee merged commit 81e0991 into main Aug 27, 2023
10 checks passed
@kevin-lee kevin-lee deleted the prepare-to-release branch August 27, 2023 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant