<commit_before>(ns nodejs.express
  (:refer-clojure :exclude [get])
  (:require [cljs.spec :as s]
            [cljs.reader :refer [read-string]]
            [goog.object :as gobj]))

(defn get [app pattern & f] (apply js-invoke app "get" pattern f))
(defn post [app pattern f] (.post app pattern f))
(defn use [app middleware] (.use app middleware))

(defn session-get [req k]
  (some-> (gobj/get (.-session req) (pr-str k))
          (str)
          (read-string)))

(s/fdef session-get
  :args (s/cat :req any? :key any? :value any?)
  :ret any?)

(defn session-set! [req k v]
  (gobj/set (gobj/get req "session") (pr-str k) (pr-str v))
  v)

(s/fdef session-set!
  :args (s/cat :req any? :key string? :value any?)
  :ret any?)

(defn session-update! [req k f]
  (let [old (session-get req k)<commit_msg>make session-get safer<commit_after>(ns nodejs.express
  (:refer-clojure :exclude [get])
  (:require [cljs.spec :as s]
            [cljs.reader :refer [read-string]]
            [goog.object :as gobj]))

(defn get [app pattern & f] (apply js-invoke app "get" pattern f))
(defn post [app pattern f] (.post app pattern f))
(defn use [app middleware] (.use app middleware))

(defn session-get [req k]
  (some-> (.-session req)
          (gobj/get (pr-str k))
          (str)
          (read-string)))

(s/fdef session-get
  :args (s/cat :req any? :key any? :value any?)
  :ret any?)

(defn session-set! [req k v]
  (gobj/set (gobj/get req "session") (pr-str k) (pr-str v))
  v)

(s/fdef session-set!
  :args (s/cat :req any? :key string? :value any?)
  :ret any?)

(defn session-update! [req k f]
  (let [old (session-get req k)
{'fraction_non_alphanumeric': 0.1747394236664623, 'fraction_numerical': 0.0, 'mean_word_length': 2.923076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5300560', 'n_tokens_mistral': 641, 'n_tokens_neox': 631, 'n_words': 205}