function | since v1.11.50 | Edit |
(parse-uuid s)
Parse a string representing a UUID and return a UUID instance, or nil if parse fails. Grammar: https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html#toString--
(defn parse-uuid
[s]
(if (string? s)
(when ^boolean (re-matches uuid-regex s)
(uuid s))
(throw (js/Error. (parsing-err s)))))