documint.util

Documint utility functions.

counter

(counter n)
An identity generator that uses ever increasing numbers.

Use in place of UUIDs when testing.

deep-merge

(deep-merge & maps)
Deeply merge maps.

fetch-content

(fetch-content uri)
Fetch the content of a URI and present it with the same structure as stored
content.

map-vals

(map-vals f m)
Map only the values in a map to produce a new map.

open-keystore

(open-keystore f password)
Open a `Keystore`.

ptransform-map

(ptransform-map pool f m)
Recursively transform every primitive value in map `m` by passing it to `f`,
while retaining the structure of `m`. Sequential values are transformed in
parallel.

swap-vals!

(swap-vals! atom f & args)
Like swap-vals! in Clojure 1.9.

time-body-ms

macro

(time-body-ms expr)
Time the specified expression and return a vector containing execution time
(in milliseconds) and the expression result.

transform-map

(transform-map f m)
Recursively transform every primitive value in map `m` by passing it to `f`,
while retaining the structure of `m`.

uuid-str

(uuid-str)(uuid-str f)
Produce factory functions that construct UUIDs represented as strings.

wait-close

(wait-close closeable waiting)
Close `closeable` when the items being waited on have all been done.

Returns a function taking one argument, the item from the `waiting` set, that
has completed.