Tupelo - Making Clojure even sweeter
Tupelo - Making Clojure even sweeter
(->kabob-kw arg)Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Keyword
Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Keyword
(->kabob-str arg)Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Str
Coerce a string, keyword, or symbol to a kabob-case-string
Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Str Coerce a string, keyword, or symbol to a kabob-case-string
(->snake-kw arg)Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Keyword
Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Keyword
(->snake-str arg)Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Str
Coerce a string, keyword, or symbol to a snake_case_string
Inputs: [arg :- (s/cond-pre s/Keyword s/Str s/Symbol)] Returns: s/Str Coerce a string, keyword, or symbol to a snake_case_string
(alpha? & args)Returns true iff every char passes tupelo.chars/alpha?
Returns true iff every char passes tupelo.chars/alpha?
(alphanumeric? & args)Returns true iff every char passes tupelo.chars/alphanumeric?
Returns true iff every char passes tupelo.chars/alphanumeric?
(char->code-point char-val)REturns the code-point of a character (len=1 string)
REturns the code-point of a character (len=1 string)
(clip-text N src-str)Inputs: [N :- s/Int src-str :- s/Str] Returns: s/Str
Given a multi-line string, returns a string with each line clipped to a max of N chars
Inputs: [N :- s/Int src-str :- s/Str] Returns: s/Str Given a multi-line string, returns a string with each line clipped to a max of N chars
(clojurize-key arg)Given a string or keyword, converts to lowercase and calls str->kw-normalized
Given a string or keyword, converts to lowercase and calls str->kw-normalized
(code-point->char code-point)Inputs: [code-point :- s/Int]
REturns the code-point of a character (len=1 string)
Inputs: [code-point :- s/Int] REturns the code-point of a character (len=1 string)
(collapse-whitespace arg)Replaces all consecutive runs of whitespace characters (including newlines) with a single space. Removes any leading or trailing whitespace. Returns a string composed of all tokens separated by a single space.
Replaces all consecutive runs of whitespace characters (including newlines) with a single space. Removes any leading or trailing whitespace. Returns a string composed of all tokens separated by a single space.
(contains-match? search-str re)Inputs: [search-str :- s/Str re :- s/Any] Returns: s/Bool
Returns true if the regex matches any portion of the intput string.
Inputs: [search-str :- s/Str re :- s/Any] Returns: s/Bool Returns true if the regex matches any portion of the intput string.
(contains-str? search-str tgt-str)Inputs: [search-str :- s/Str tgt-str :- s/Str] Returns: s/Bool
Returns true if the intput string contains the target string.
Inputs: [search-str :- s/Str tgt-str :- s/Str] Returns: s/Bool Returns true if the intput string contains the target string.
(digit? & args)Returns true iff every char passes tupelo.chars/digit?
Returns true iff every char passes tupelo.chars/digit?
(drop n txt)Inputs: [n :- s/Int txt :- s/Str] Returns: s/Str
Drops the first N chars of a string, returning a string result.
Inputs: [n :- s/Int txt :- s/Str] Returns: s/Str Drops the first N chars of a string, returning a string result.
(equals-ignore-spacing? & args)Renamed => nonblank=
Renamed => `nonblank=`
(fgrep tgt text)Inputs: [tgt :- s/Str text :- s/Str]
Given a multi-line text string, returns a string containing lines matching the target string.
Inputs: [tgt :- s/Str text :- s/Str] Given a multi-line text string, returns a string containing lines matching the target string.
(grep pattern text)Inputs: [pattern :- s/Regex text :- s/Str]
Given a multi-line text string, returns a string containing lines matching a regex pattern.
Inputs: [pattern :- s/Regex text :- s/Str] Given a multi-line text string, returns a string containing lines matching a regex pattern.
(hex? & args)Returns true iff every char passes tupelo.chars/hex?
Returns true iff every char passes tupelo.chars/hex?
(increasing-or-equal? a b)Inputs: [a :- s/Str b :- s/Str] Returns: s/Bool
Returns true if a pair of strings are in increasing lexicographic order, or equal.
Inputs: [a :- s/Str b :- s/Str] Returns: s/Bool Returns true if a pair of strings are in increasing lexicographic order, or equal.
(increasing? a b)Inputs: [a :- s/Str b :- s/Str] Returns: s/Bool
Returns true if a pair of strings are in increasing lexicographic order.
Inputs: [a :- s/Str b :- s/Str] Returns: s/Bool Returns true if a pair of strings are in increasing lexicographic order.
(indent n txt)Inputs: [n :- s/Int txt :- s/Str] Returns: s/Str
Indents a string by pre-pending N spaces. Returns a string result.
Inputs: [n :- s/Int txt :- s/Str] Returns: s/Str Indents a string by pre-pending N spaces. Returns a string result.
(indent-lines n txt)Inputs: [n :- s/Int txt :- s/Str] Returns: s/Str
Splits out each line of txt using clojure.string/split-lines, then indents each line by prepending N spaces. Joins lines together into a single string result, with each line terminated by a single ewline.
Inputs: [n :- s/Int txt :- s/Str] Returns: s/Str Splits out each line of txt using clojure.string/split-lines, then indents each line by prepending N spaces. Joins lines together into a single string result, with each line terminated by a single ewline.
(indent-lines-with indent-str txt)Inputs: [indent-str :- s/Str txt :- s/Str] Returns: s/Str
Splits out each line of txt using clojure.string/split-lines, then indents each line by prepending it with the supplied string. Joins lines together into a single string result, with each line terminated by a single ewline.
Inputs: [indent-str :- s/Str txt :- s/Str] Returns: s/Str Splits out each line of txt using clojure.string/split-lines, then indents each line by prepending it with the supplied string. Joins lines together into a single string result, with each line terminated by a single ewline.
(lowercase= & args)(lowercase= & rest54513)Inputs: [& args :- [s/Str]] Returns: s/Bool
Compares strings for equality after applying clojure.string/lower-case.
Inputs: [& args :- [s/Str]] Returns: s/Bool Compares strings for equality after applying clojure.string/lower-case.
(lowercase? & args)Returns true iff every char passes tupelo.chars/lowercase?
Returns true iff every char passes tupelo.chars/lowercase?
(nonblank-lines= & args)(nonblank-lines= & rest54495)Inputs: [& args :- [s/Str]] Returns: s/Bool
Compares corresponding lines of input strings for equality using tupelo.misc/collapse-whitespace.
Inputs: [& args :- [s/Str]] Returns: s/Bool Compares corresponding lines of input strings for equality using tupelo.misc/collapse-whitespace.
(nonblank= & args)(nonblank= & rest54489)Inputs: [& args :- [s/Str]] Returns: s/Bool
Compares strings for equality using tupelo.misc/collapse-whitespace. Equivalent to separating tokens by whitespace and comparing the resulting sequences.
Inputs: [& args :- [s/Str]] Returns: s/Bool Compares strings for equality using tupelo.misc/collapse-whitespace. Equivalent to separating tokens by whitespace and comparing the resulting sequences.
(normalize-str str-in)Returns a 'normalized' version of str-in, stripped of leading/trailing blanks, and with all non-alphanumeric chars converted to hyphens.
Returns a 'normalized' version of str-in, stripped of leading/trailing blanks, and with all non-alphanumeric chars converted to hyphens.
(not-blank? it)Returns true if the string is not blank.
Returns true if the string is not blank.
(pad-left str-val N)(pad-left str-val N pad-char)(pad-left G__54633 G__54634)(pad-left G__54638 G__54639 G__54640)Inputs: ([str-val :- s/Str N :- s/Int] [str-val :- s/Str N :- s/Int pad-char]) Returns: s/Str
Pads a string on the left until it is at least N chars in size
Inputs: ([str-val :- s/Str N :- s/Int] [str-val :- s/Str N :- s/Int pad-char]) Returns: s/Str Pads a string on the left until it is at least N chars in size
(pad-right str-val N)(pad-right str-val N pad-char)(pad-right G__54647 G__54648)(pad-right G__54652 G__54653 G__54654)Inputs: ([str-val :- s/Str N :- s/Int] [str-val :- s/Str N :- s/Int pad-char]) Returns: s/Str
Pads a string on the right until it is at least N chars in size
Inputs: ([str-val :- s/Str N :- s/Int] [str-val :- s/Str N :- s/Int pad-char]) Returns: s/Str Pads a string on the right until it is at least N chars in size
A map from keyword character to string phonetic name: {:a "alpha" :b "bravo" :c "charlie" :d "delta" :e "echo" :f "foxtrot" :g "golf" :h "hotel" :i "india" :j "juliett" :k "kilo" :l "lima" :m "mike" :n "november" :o "oscar" :p "papa" :q "quebec" :r "romeo " :s "sierra" :t "tango" :u "uniform" :v "victor" :w "whiskey" :x "x-ray" :y "yankee" :z "zulu" }
A map from keyword character to string phonetic name:
{:a "alpha" :b "bravo" :c "charlie" :d "delta" :e "echo" :f "foxtrot" :g "golf"
:h "hotel" :i "india" :j "juliett" :k "kilo" :l "lima" :m "mike" :n "november"
:o "oscar" :p "papa" :q "quebec" :r "romeo " :s "sierra" :t "tango" :u "uniform"
:v "victor" :w "whiskey" :x "x-ray" :y "yankee" :z "zulu" } (pluralize-with N base-str)Returns base-str when N=1; otherwise appends an s
Returns `base-str` when N=1; otherwise appends an `s`
(quotes->double arg)Inputs: [arg :- s/Str] Returns: s/Str
Converts all single-quotes in a string to double-quotes
Inputs: [arg :- s/Str] Returns: s/Str Converts all single-quotes in a string to double-quotes
(quotes->single arg)Inputs: [arg :- s/Str] Returns: s/Str
Converts all double-quotes in a string to single-quotes
Inputs: [arg :- s/Str] Returns: s/Str Converts all double-quotes in a string to single-quotes
(str->kw-normalized arg)Returns a keyword constructed from a normalized string
Returns a keyword constructed from a normalized string
(str-keep-left str-val n)Keeps the N left-most chars of a string
Keeps the N left-most chars of a string
(str-keep-right str-val n)Keeps the N right-most chars of a string
Keeps the N right-most chars of a string
(string->stream str-val)Inputs: [str-val :- s/Str] Returns: InputStream
Inputs: [str-val :- s/Str] Returns: InputStream
(tabs->spaces src-str)(tabs->spaces tab-size src-str)(tabs->spaces G__54473)(tabs->spaces G__54477 G__54478)Inputs: ([src-str :- s/Str] [tab-size :- s/Int src-str :- s/Str]) Returns: s/Str
Replaces all tabs with appropriate number of spaces (default tab-size => 8)
Usage: (tabs->spaces 'abc<tab>def' => 'ab cd' (tabs->spaces 4 'ab<tab>cd' => 'ab cd'
Inputs: ([src-str :- s/Str] [tab-size :- s/Int src-str :- s/Str])
Returns: s/Str
Replaces all tabs with appropriate number of spaces (default tab-size => 8)
Usage: (tabs->spaces 'abc<tab>def' => 'ab cd'
(tabs->spaces 4 'ab<tab>cd' => 'ab cd'
(take n txt)Inputs: [n :- s/Int txt :- s/Str] Returns: s/Str
Drops the first N chars of a string, returning a string result.
Inputs: [n :- s/Int txt :- s/Str] Returns: s/Str Drops the first N chars of a string, returning a string result.
(text? & args)Returns true iff every char passes tupelo.chars/text?
Returns true iff every char passes tupelo.chars/text?
(uppercase? & args)Returns true iff every char passes tupelo.chars/uppercase?
Returns true iff every char passes tupelo.chars/uppercase?
(visible? & args)Returns true iff every char passes tupelo.chars/visible?
Returns true iff every char passes tupelo.chars/visible?
(walk-clojurize-keys form)Recursively walks form, normalizing all map keys via clojurize-key.
Recursively walks form, normalizing all map keys via `clojurize-key`.
(walk-keywords->strings form)Recursively walks form, converting all keywords to strings.
Recursively walks form, converting all keywords to strings.
(walk-strings->keywords form)Recursively walks form, converting all strings to keywords.
Recursively walks form, converting all strings to keywords.
(whitespace-eol? & args)Returns true iff every char passes tupelo.chars/whitespace-eol?
Returns true iff every char passes tupelo.chars/whitespace-eol?
(whitespace-horiz? & args)Returns true iff every char passes tupelo.chars/whitespace-horiz?
Returns true iff every char passes tupelo.chars/whitespace-horiz?
(whitespace? & args)Returns true iff every char passes tupelo.chars/whitespace?
Returns true iff every char passes tupelo.chars/whitespace?
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |