Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Imuta

Simple js library to make your functional code better :)

Install

bower install imuta --save

Main functions reference

  • Imuta.clone(any_term) -> any_term : recursively clone any js term and return its copy
  • Imuta.equal(term_a,term_b) -> boolean : recursively compare any pair of js terms by values
  • Imuta.flatten(list) -> list : recursively make new flatten list from any list(of lists of lists etc / or any terms), recursively clone all its elemets
  • Imuta.put_in(obj, path, value) -> puts clone of value to nested path of structure obj
  • Imuta.get_in(obj, path) -> gets clone of value from nested path of structure obj.. if not exisits returns undefined
  • Imuta.update_in(obj, path, func) -> updates value in nested path of structure obj.. if not exisits - raise exception

And some simple boolean functions

  • is_undefined(t)
  • is_boolean(t)
  • is_number(t)
  • is_string(t)
  • is_function(t)
  • is_null(t)
  • is_list(t)
  • is_map(t)

WARNING

Cyclic references always gives stack overflow!!!

About

crazy small js lib to operate data using functional style (erlang, lisp, haskell etc)

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages