• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CaptainFact / captain-fact-api / d8cabaf84f8820033ca4cecdd65090e65d7472c1

25 Feb 2025 08:17PM UTC coverage: 51.933% (-1.6%) from 53.525%
d8cabaf84f8820033ca4cecdd65090e65d7472c1

Pull #493

github

Betree
deps: Upgrade to Elixir 14
Pull Request #493: deps: Upgrade to Elixir 14

1142 of 2199 relevant lines covered (51.93%)

7.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/apps/db/lib/db_utils/string.ex
1
defmodule DB.Utils.String do
2
  @moduledoc """
3
  String utils not included in base library
4
  """
5

6
  @doc """
7
  Convert a string like "     aaa     bbb ccc  " into "aaa bbb ccc"
8

9
  ## Examples
10

11
      iex> DB.Utils.String.trim_all_whitespaces "     aaa     bbb ccc  "
12
      "aaa bbb ccc"
13
      iex> DB.Utils.String.trim_all_whitespaces ""
14
      ""
15
  """
16
  def trim_all_whitespaces(nil),
×
17
    do: nil
18

19
  def trim_all_whitespaces(str) do
20
    str
21
    |> String.trim()
22
    |> String.replace(~r/\s+/, " ")
17✔
23
  end
24

25
  def upcase(nil), do: nil
×
26

27
  def upcase(str), do: String.upcase(str)
4✔
28
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc