We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4164f95 commit 6e06f85Copy full SHA for 6e06f85
1 file changed
src/xapi_schema/spec.cljc
@@ -1375,11 +1375,11 @@
1375
(defn unique-statement-ids?
1376
"Spec predicate to ensure that the IDs of a list of statements are unique."
1377
[statements]
1378
- (or
1379
- (empty? statements)
1380
- (reduce distinct?
1381
- (map #(get % "id") statements))
1382
- ::s/invalid))
+ (let [ids (keep #(get % "id") statements)]
+ (or
+ (empty? ids)
+ (reduce distinct? ids)
+ ::s/invalid)))
1383
1384
(s/def ::statements
1385
(s/and
0 commit comments