Allows paste plain text into worskpace

This commit is contained in:
alonso.torres 2020-09-22 12:24:01 +02:00 committed by Andrey Antukh
parent bd31e5742f
commit a227a0fe21
2 changed files with 78 additions and 12 deletions

View file

@ -94,3 +94,10 @@
(t/write w data))
(catch :default e
(throw e))))
(defn transit?
"Checks if a string can be decoded with transit"
[str]
(try
(-> str decode nil? not)
(catch js/SyntaxError e false)))