Helpers for | (ns metabase.lib.ident (:require [metabase.util :as u])) |
Generates a new, randomized, globally unique | (defn random-ident [] (u/generate-nano-id)) |
Replaces all the values in the given map with [[random-ident]]s, using the original keys. | (defn keyed-idents [m] (when (seq m) (update-vals m (fn [_] (random-ident))))) |
Given a | (defn indexed-idents [xs-or-number] (let [lhs (if (number? xs-or-number) (range xs-or-number) (range (count xs-or-number)))] (not-empty (zipmap lhs (repeatedly random-ident))))) |