mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 10:38:13 -05:00
🎉 Add d/unstable-sort
helper
This commit is contained in:
parent
59600d07c3
commit
ce0842ce87
1 changed files with 13 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
:clj [clojure.edn :as r])
|
||||
#?(:cljs [cljs.core :as c]
|
||||
:clj [clojure.core :as c])
|
||||
#?(:cljs [goog.array :as garray])
|
||||
[app.common.math :as mth]
|
||||
[clojure.set :as set]
|
||||
[cuerdas.core :as str]
|
||||
|
@ -780,6 +781,18 @@
|
|||
(toString 16)
|
||||
(padStart 2 "0"))))
|
||||
|
||||
(defn unstable-sort
|
||||
([items]
|
||||
(unstable-sort compare items))
|
||||
([comp-fn items]
|
||||
#?(:cljs
|
||||
(let [items (to-array items)]
|
||||
(garray/sort items comp-fn)
|
||||
(seq items))
|
||||
:clj
|
||||
(sort comp-fn items))))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; String Functions
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Reference in a new issue