Added concat-str-vec with string-vector? pred
This commit is contained in:
parent
d644e81345
commit
c3a14c96d1
3 changed files with 18 additions and 2 deletions
|
@ -58,6 +58,11 @@
|
||||||
(into []
|
(into []
|
||||||
(apply concat vs)))
|
(apply concat vs)))
|
||||||
|
|
||||||
|
(defn-spec concat-str-vec cp/string-vector?
|
||||||
|
[& vs (s/* seq?)]
|
||||||
|
(into []
|
||||||
|
(apply concat vs)))
|
||||||
|
|
||||||
(defn generate-common [my-config my-auth config-defaults k8s-objects]
|
(defn generate-common [my-config my-auth config-defaults k8s-objects]
|
||||||
(let [resulting-config (merge config-defaults my-config my-auth)]
|
(let [resulting-config (merge config-defaults my-config my-auth)]
|
||||||
(cs/join
|
(cs/join
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
(and (string? input)
|
(and (string? input)
|
||||||
(some? (re-matches #"(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)" input))))
|
(some? (re-matches #"(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)" input))))
|
||||||
|
|
||||||
(defn string-of-separated-by?
|
(defn string-of-separated-by?
|
||||||
[spec-function separator input]
|
[spec-function separator input]
|
||||||
(every? true? (map spec-function (str/split input separator))))
|
(every? true? (map spec-function (str/split input separator))))
|
||||||
|
|
||||||
|
@ -44,3 +44,9 @@
|
||||||
(fqdn-string? (first split-string))
|
(fqdn-string? (first split-string))
|
||||||
(port-number? (edn/read-string (second split-string)))))))
|
(port-number? (edn/read-string (second split-string)))))))
|
||||||
|
|
||||||
|
(defn string-vector?
|
||||||
|
[input]
|
||||||
|
(and (vector? input)
|
||||||
|
(every? true?
|
||||||
|
(map #(string? %) input))))
|
||||||
|
|
||||||
|
|
|
@ -49,4 +49,9 @@
|
||||||
(is (true? (cut/host-and-port-string? "test.de:1234")))
|
(is (true? (cut/host-and-port-string? "test.de:1234")))
|
||||||
(is (false? (cut/host-and-port-string? "test.de,1234")))
|
(is (false? (cut/host-and-port-string? "test.de,1234")))
|
||||||
(is (false? (cut/host-and-port-string? "test.123:1234")))
|
(is (false? (cut/host-and-port-string? "test.123:1234")))
|
||||||
(is (false? (cut/host-and-port-string? "test.de:abc"))))
|
(is (false? (cut/host-and-port-string? "test.de:abc"))))
|
||||||
|
|
||||||
|
(deftest test-string-vector?
|
||||||
|
(is (true? (cut/string-vector? ["hallo" "welt" "!"])))
|
||||||
|
(is (false? (cut/string-vector? ["hallo" 1 "welt" "!"])))
|
||||||
|
(is (false? (cut/string-vector? "hallo welt!"))))
|
Loading…
Reference in a new issue