(extract-field-value field body)
extract field value, by converting string into other objects, uuid is the only conversion so far <br>
extract field value, by converting string into other objects, uuid is the only conversion so far <br> - *field* ^ks: ks (field) to be extracted from *body* - *body* ^map: the body map where key-values will be extracted
(mop-fields body fields)
mop fields, removing unwanted key-values <br>
mop fields, removing unwanted key-values <br> - *body* ^map: the body map where key-values will be checked and/or removed - *fields* ^coll: ["field-0-name","field-n-name"] => accepted fields, the other ones will be removed
(validate-and-mop!! body to-validate accepted)
(validate-and-mop!! body to-validate accepted field-message)
validates fields and mop then, removing unwanted key-values <br>
<br> {:validate/type :validate/min, :validate/value 12 & :validate/message "% is mandatory"}, <br> {:validate/type :validate/max, :validate/value 40 & :validate/message "% is ..."}, <br> {:validate/type :validate/regex, :validate/value #"^[\d]{1,2}$" & :validate/message "% is ..."}, <br> {:validate/type :validate/custom, :validate/value fn & :validate/message "% is ..."}]} - *to-validate* ^coll: ["field-0-name","field-n-name"] => validates only mandatoryness. - *accepted* ^coll: ["field-0-name","field-n-name"] => accepted fields, the other ones will be removed - & *field-message* ^string: Default field message, is used just if to-validate is coll
validates fields and mop then, removing unwanted key-values <br> - *body* ^map: the body map where key-values will be checked and/or removed - *to-validate* ^map: {"field-name" [{:validate/type :validate/mandatory & :validate/message "%s is ..."}, <br> {:validate/type :validate/min, :validate/value 12 & :validate/message "% is mandatory"}, <br> {:validate/type :validate/max, :validate/value 40 & :validate/message "% is ..."}, <br> {:validate/type :validate/regex, :validate/value #"^[\d]{1,2}$" & :validate/message "% is ..."}, <br> {:validate/type :validate/custom, :validate/value fn & :validate/message "% is ..."}]} - *to-validate* ^coll: ["field-0-name","field-n-name"] => validates only mandatoryness. - *accepted* ^coll: ["field-0-name","field-n-name"] => accepted fields, the other ones will be removed - & *field-message* ^string: Default field message, is used just if to-validate is coll
(validate-mandatory body fields)
(validate-mandatory body fields message-untranslated)
validates mandatory fields <br>
validates mandatory fields <br> - *body* ^map: the body map where key-values will be checked and/or removed - *fields* ^coll: ["field-0-name","field-n-name"] - & *field-message* ^string: Default field message
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close