Skip to content

Commit 51a5b05

Browse files
committed
CLJS-3361: Add docstrings to uuid, uuid?, and random-uuid
1 parent 052e731 commit 51a5b05

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11575,11 +11575,15 @@ reduces them without incurring seq initialization"
1157511575
(garray/defaultCompare uuid (.-uuid other))
1157611576
(throw (js/Error. (str "Cannot compare " this " to " other))))))
1157711577

11578-
(defn uuid [s]
11578+
(defn uuid
11579+
"Returns a UUID consistent with the string s."
11580+
[s]
1157911581
(assert (string? s))
1158011582
(UUID. (.toLowerCase s) nil))
1158111583

11582-
(defn random-uuid []
11584+
(defn random-uuid
11585+
"Returns a pseudo-randomly generated UUID instance (i.e. type 4)."
11586+
[]
1158311587
(letfn [(hex [] (.toString (rand-int 16) 16))]
1158411588
(let [rhex (.toString (bit-or 0x8 (bit-and 0x3 (rand-int 16))) 16)]
1158511589
(uuid
@@ -11593,6 +11597,7 @@ reduces them without incurring seq initialization"
1159311597
(hex) (hex) (hex) (hex))))))
1159411598

1159511599
(defn uuid?
11600+
"Return true if x is a UUID."
1159611601
[x] (implements? IUUID x))
1159711602

1159811603
;;; ExceptionInfo

0 commit comments

Comments
 (0)