Back

includes? (clj)

(source)

function

(includes? s subs)
Determines whether a string contains a substring.

Examples

penpot/penpot
(ns app.main.ui.workspace.sidebar.layer-name
  (:require-macros [app.main.style :as stl])
  (:require
   [app.common.data :as d]
   [app.common.data.macros :as dm]
   [app.main.data.workspace :as dw]
   [app.main.store :as st]
   [app.util.debug :as dbg]
   [app.util.dom :as dom]
   [app.util.keyboard :as kbd]
   [cuerdas.core :as str]
   [okulary.core :as l]
   [rumext.v2 :as mf]))

        has-path?        (str/includes? shape-name "/")
penpot/penpot
(ns app.main.ui.workspace.sidebar.options.menus.component
  (:require-macros [app.main.style :as stl])
  (:require
   [app.common.files.helpers :as cfh]
   [app.common.types.component :as ctk]
   [app.common.types.file :as ctf]
   [app.common.uuid :as uuid]
   [app.main.data.modal :as modal]
   [app.main.data.workspace :as dw]
   [app.main.data.workspace.libraries :as dwl]
   [app.main.data.workspace.specialized-panel :as dwsp]
   [app.main.refs :as refs]
   [app.main.store :as st]
   [app.main.ui.components.dropdown :refer [dropdown]]
   [app.main.ui.components.radio-buttons :refer [radio-button radio-buttons]]
   [app.main.ui.components.search-bar :refer [search-bar]]
   [app.main.ui.components.select :refer [select]]
   [app.main.ui.components.title-bar :refer [title-bar]]
   [app.main.ui.context :as ctx]
   [app.main.ui.hooks :as h]
   [app.main.ui.icons :as i]
   [app.main.ui.workspace.sidebar.assets.common :as cmm]
   [app.util.dom :as dom]
   [app.util.i18n :as i18n :refer [tr]]
   [cuerdas.core :as str]
   [rumext.v2 :as mf]))

        components          (if is-search?
                              (filter #(str/includes? (str/lower (:full-name %)) (str/lower (:term filters))) components)
                              (filter #(= (:path %) (:path filters)) components))
macchiato-framework/macchiato-core
(ns macchiato.test.middleware.anti-forgery
  (:require
    [cuerdas.core :as string]
    [macchiato.middleware.anti-forgery :as af]
    [macchiato.test.mock.request :refer [header request]]
    [macchiato.test.mock.util :refer [mock-handler raw-response ok-response]]
    [cljs.test :refer-macros [is are deftest testing use-fixtures]]))

(deftest no-lf-in-token-test
    (letfn [(handler [request respond raise]
              (respond
                {:status  200
                 :headers {}
                 :body    af/*anti-forgery-token*}))]
      (let [response ((mock-handler af/wrap-anti-forgery handler) (request :get "/"))
            token    (get-in response [:session ::af/anti-forgery-token])]
        (is (not (string/includes? token "\n"))))))