clj-cctray.util

Utility functions.

in?

(in? seq elm)
Returns true if the given element is in the given sequence.

keywordize-camel

(keywordize-camel camel-str)
Converts the given camel cased string into a clojure style keyword.

For example: "CamelCase" => :camel-case

keywordize-camel-keys

(keywordize-camel-keys m)
Converts all the keys in the given map into keywords.

normalise-key

(normalise-key key map)
Normalises the given key in the given map which means it is lower cased and sentenceized.

For example:

    "CamelCased_SNAKE-kebab.DoT" => "camel cased snake kebab dot"

normalise-string

(normalise-string str)
Normalises the given string which means it is lower cased and sentenceized.

For example:

    "CamelCased_SNAKE-kebab.DoT" => "camel cased snake kebab dot"

sentenceize

(sentenceize str)
Sentenceizes the given string which means camel, snake, kebab and dot cased strings are turned into normal sentences
with spaces. This function will not split the following:

1. Multiple uppercased letters in a row
2. Digits separated by dots
3. x or * separated by dots

This is in an attempt to keep acronyms/initialisms and version numbers from getting split.

For example:

    "CamelCased_SNAKE-kebab.dot_JSON-1.2.x" => "Camel Cased SNAKE kebab dot JSON 1.2.x"