Liking cljdoc? Tell your friends :D

hara.data.base.transform


find-templatesclj

(find-templates m)
(find-templates m path saved)

finds the template with associated path

(find-templates {:hash "{{hash}}" :salt "{{salt}}" :email "{{email}}" :user {:firstname "{{firstname}}" :lastname "{{lastname}}"}}) => {"{{hash}}" [:hash] "{{salt}}" [:salt] "{{email}}" [:email] "{{firstname}}" [:user :firstname] "{{lastname}}" [:user :lastname]}

finds the template with associated path

(find-templates {:hash  "{{hash}}"
                 :salt  "{{salt}}"
                 :email "{{email}}"
                 :user {:firstname "{{firstname}}"
                        :lastname  "{{lastname}}"}})
=> {"{{hash}}" [:hash]
    "{{salt}}" [:salt]
    "{{email}}" [:email]
   "{{firstname}}" [:user :firstname]
    "{{lastname}}" [:user :lastname]}
raw docstring

template?clj

(template? s)

checks if an object is a template

(template? "{{template}}") => true

(template? :not-one) => false

checks if an object is a template

(template? "{{template}}")
=> true

(template? :not-one)
=> false
raw docstring

transformclj

(transform schema [from to] data)

creates a transformation function (transform {:keystore {:hash "{{hash}}" :salt "{{salt}}" :email "{{email}}"}

        :db       {:login {:type :email
                           :user {:hash "{{hash}}"
                                  :salt "{{salt}}"}
                           :value "{{email}}"}}}
      [:keystore :db]
       {:hash "1234"
        :salt "ABCD"
        :email "a@a.com"})

=> {:login {:type :email, :user {:hash "1234", :salt "ABCD"}, :value "a@a.com"}}

creates a transformation function
(transform {:keystore {:hash  "{{hash}}"
                       :salt  "{{salt}}"
                       :email "{{email}}"}

            :db       {:login {:type :email
                               :user {:hash "{{hash}}"
                                      :salt "{{salt}}"}
                               :value "{{email}}"}}}
          [:keystore :db]
           {:hash "1234"
            :salt "ABCD"
            :email "a@a.com"})
=> {:login {:type :email,
            :user {:hash "1234",
                   :salt "ABCD"},
            :value "a@a.com"}}
raw docstring

transform-fnclj

(transform-fn schema [from to])

creates a transformation function ((transform-fn {:keystore {:hash "{{hash}}" :salt "{{salt}}" :email "{{email}}"}

            :db       {:login {:type :email
                               :user {:hash "{{hash}}"
                                      :salt "{{salt}}"}
                               :value "{{email}}"}}}
          [:keystore :db])

{:hash "1234" :salt "ABCD" :email "a@a.com"}) => {:login {:type :email, :user {:hash "1234", :salt "ABCD"}, :value "a@a.com"}}

creates a transformation function
((transform-fn {:keystore {:hash  "{{hash}}"
                           :salt  "{{salt}}"
                           :email "{{email}}"}

                :db       {:login {:type :email
                                   :user {:hash "{{hash}}"
                                          :salt "{{salt}}"}
                                   :value "{{email}}"}}}
              [:keystore :db])
 {:hash "1234"
  :salt "ABCD"
  :email "a@a.com"})
=> {:login {:type :email,
            :user {:hash "1234",
                   :salt "ABCD"},
            :value "a@a.com"}}
raw docstring

transform-fn*clj

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close