0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-22 23:06:08 -05:00

📎 Use standard asserts on binfile common ns

This commit is contained in:
Andrey Antukh 2025-02-19 12:13:40 +01:00
parent a391d71b60
commit ca9b5b1b8a

View file

@ -9,7 +9,6 @@
binfile format implementations and management rpc methods." binfile format implementations and management rpc methods."
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.data.macros :as dm]
[app.common.exceptions :as ex] [app.common.exceptions :as ex]
[app.common.features :as cfeat] [app.common.features :as cfeat]
[app.common.files.helpers :as cfh] [app.common.files.helpers :as cfh]
@ -219,10 +218,8 @@
"Given a set of file-id's, return all matching relations with the libraries" "Given a set of file-id's, return all matching relations with the libraries"
[cfg ids] [cfg ids]
(dm/assert! (assert (set? ids) "expected a set of uuids")
"expected a set of uuids" (assert (every? uuid? ids) "expected a set of uuids")
(and (set? ids)
(every? uuid? ids)))
(db/run! cfg (fn [{:keys [::db/conn]}] (db/run! cfg (fn [{:keys [::db/conn]}]
(let [ids (db/create-array conn "uuid" ids) (let [ids (db/create-array conn "uuid" ids)
@ -503,9 +500,7 @@
specific, should not be used outside of binfile domain" specific, should not be used outside of binfile domain"
[{:keys [::timestamp] :as cfg} file & {:as opts}] [{:keys [::timestamp] :as cfg} file & {:as opts}]
(dm/assert! (assert (dt/instant? timestamp) "expected valid timestamp")
"expected valid timestamp"
(dt/instant? timestamp))
(let [file (-> file (let [file (-> file
(assoc :created-at timestamp) (assoc :created-at timestamp)