Back

capital (clj)

(source)

function

(capital s)
Uppercases the first character of a string

Examples

penpot/penpot
(ns app.main.ui.icons
  (:require
   [clojure.core :as c]
   [cuerdas.core :as str]
   [rumext.v2]))

(defmacro collect-icons
  []
  (let [ns-info (:ns &env)]
    `(cljs.core/js-obj
      ~@(->> (:defs ns-info)
             (map val)
             (filter (fn [entry] (-> entry :meta :icon)))
             (mapcat (fn [{:keys [name] :as entry}]
                       [(-> name c/name str/camel str/capital) name]))))))
PacktWorkshops/The-Clojure-Workshop
(ns hello-test.core-test
  (:require [cljs.test :refer-macros [are async deftest is testing]]
            [clojure.test.check.generators :as gen]
            [clojure.test.check.properties :refer-macros [for-all]]
            [clojure.test.check.clojure-test :refer-macros [defspec]]
            [cuerdas.core :as str]
            [hello-test.core :refer [profanity-filter http-get prefix-digit-remover]]))

(deftest capitalize-test-is
         (testing "Test capitalize? function using is macro"
                  (is (= "Katy" (str/capitalize "katy")))
                  (is (= "John" (str/capital "john")))
                  (is (= "Mike" (str/capitalize "mike")))))

(deftest capitalize-test-are
         (testing "Test capitalize? function using are macro"
                 (are [name-capitalized name] (= name-capitalized (str/capitalize name))
                      "Amanda" "amanda"
                      "Rob" "rob"
                      "Dan" "dan")))