Skip to content

henryw374/js-literal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-literal

like inbuilt cljs #js literal, but recursive

calling clj->js will be equivalent, but will be less efficient, going via cljs datastructures. So, efficiency-wise this literal comes between cljs->js and using #js literal all the way down.

Usage

Clojars Project

in my/source.cljs

(ns my.source
  ; no :require needed
)

(def my-literal #j/s [:a {:b [:c]}])

; compiles to => Array.of("a",Object.fromEntries(Array.of(Array.of("b",Array.of("c")))));
; under advanced compilation, compiles to ["a",Object.fromEntries([["b",["c"]]])]
; if you can improve on the above, IOW object literal syntax etc, please PR

Development

run (compile/build) from the test dir

Release

create a git tag.

make install VERSION=your-tag (this installs in ~/.m2 - check that things look ok)

make deploy VERSION=your-tag - you need to have set up clojars credentials as per https://github.com/applied-science/deps-library

git push origin new-tag-name

About

like inbuilt cljs #js literal, but recursive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published