Functions for working with JavaScript that mirror Clojure behaviour.
Functions for working with JavaScript that mirror Clojure behaviour.
(apply obj k args)
(apply obj k arg-array)
(assoc! obj & pairs)
Sets key-value pairs on obj
, returns obj
.
Sets key-value pairs on `obj`, returns `obj`.
(assoc-in! obj ks v)
(assoc-in! obj [k & ks] v)
Mutates the value in a nested object structure, where ks is a sequence of keys and v is the new value. If any levels do not exist, objects will be created.
Mutates the value in a nested object structure, where ks is a sequence of keys and v is the new value. If any levels do not exist, objects will be created.
(assoc-in* obj [k* & ks*] v)
(call obj k & args)
(contains? obj k)
(contains?* obj k*)
(get obj k)
(get obj k not-found)
Returns the value mapped to key, not-found or nil if key not present.
Returns the value mapped to key, not-found or nil if key not present.
(get-in obj ks)
(get-in obj ks not-found)
Returns the value in a nested object structure, where ks is a sequence of keys. Returns nil if the key is not present, or the not-found value if supplied.
Returns the value in a nested object structure, where ks is a sequence of keys. Returns nil if the key is not present, or the not-found value if supplied.
(get-in* obj ks*)
(get-in* obj ks* not-found)
(lookup obj)
Returns object which implements ILookup and reads keys from obj
.
Returns object which implements ILookup and reads keys from `obj`.
(obj & keyvals)
Create JavaSript object from an even number arguments representing interleaved keys and values. Dot-prefixed symbol keys will be renamable.
Create JavaSript object from an even number arguments representing interleaved keys and values. Dot-prefixed symbol keys will be renamable.
(push! a v)
(select-keys obj ks)
Returns an object containing only those entries in o
whose key is in ks
Returns an object containing only those entries in `o` whose key is in `ks`
(select-keys* obj ks*)
Returns an object containing only those entries in o
whose key is in ks
Returns an object containing only those entries in `o` whose key is in `ks`
(unchecked-get obj k)
(unchecked-set obj & pairs)
(unchecked-set obj k val)
(unshift! a v)
(update! obj k f & args)
'Updates' a value in a JavaScript object, where k is a key and f is a function that will take the old value and any supplied args and return the new value, which replaces the old value. If the key does not exist, nil is passed as the old value.
'Updates' a value in a JavaScript object, where k is a key and f is a function that will take the old value and any supplied args and return the new value, which replaces the old value. If the key does not exist, nil is passed as the old value.
(update-in! obj ks f & args)
'Updates' a value in a nested object structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, mutating the nested structure. If any levels do not exist, objects will be created.
'Updates' a value in a nested object structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, mutating the nested structure. If any levels do not exist, objects will be created.
(update-in* obj ks* f args)
(wrap-key k)
(wrap-key k obj)
Convert key to string at compile time when possible.
Convert key to string at compile time when possible.
(wrap-key k)
Returns k
or, if it is a keyword, its name.
Returns `k` or, if it is a keyword, its name.
(wrap-keys ks)
Fallback to wrapping keys at runtime
Fallback to wrapping keys at runtime
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close