(ns ombs.funcs "contains generic functions")

(defn in?
  "checks if value contained in collection. Used for vectors. For maps, use 'some'"
  [v coll]
  (boolean (some #(= v %) coll))
  )

(defn as-vec
  "get a vector or value and represents it as vector. [1 2 3] -> [1 2 3]; 1 -> [1]"
  [x] (if-not (vector? x) 
        (conj [] x)
        x))

(defn parse-int [s]
   (when-let [r (re-find  #"\d+" s )] (Integer. r)))

(ns ombs.funcs "contains generic functions")

(defn in?
  "checks if value contained in collection. Used for vectors. For maps, use 'some'"
  [v coll]
  (boolean (some #(= v %) coll))
  )

(defn as-vec
  "get a vector or value and represents it as vector. [1 2 3] -> [1 2 3]; 1 -> [1]"
  [x] (if-not (vector? x) 
        (conj [] x)
        x))

(defn parse-int [s]
   (when-let [r (re-find  #"\d+" s )] (Integer. r)))

(defn nil-fix
 "Replace nil value to 0"
 [v] (if (nil? v) 0 v))

Add nil fix in hash-map func.
[up] Add nil fix in hash-map func.

Intey/OhMyBank,Intey/OhMyBank,Intey/OhMyBank,Intey/OhMyBank