dot-notes v1.0.0 DotNotes.Create

Module containing creation based actions for DotNotes. Due to the recursion it made sense to split this into a separate module in order to avoid bloating the main module with private functions.

Summary

Functions

Creates a key/value pair inside a haystack using a path

Types

haystack :: %{} | []

Functions

execute(haystack, path, value)

Specs

execute(haystack | nil, path :: binary, value :: any) :: haystack

Creates a key/value pair inside a haystack using a path.

Most of the heavy lifting here is done by the recursive (and private) create_nest/3 function which iterates deeper into the haystack. We use DotNotes.keys/1 to generate our key list rather than reimplementing a parser here.