Callable Nest

A callable nest is a type of callable class. In this case it's a Nest() class that can be called as a function. A Nest() is a class made to easily manage nested objects. It can be created in the following ways.
Copy
Once created you can use it as a function. The callable map will return the value of the key passed as an argument. If the key does not exist in the map, it will return undefined.
Copy

data

Returns the entire session object.
Copy

size

Returns the number of key/value pairs in the map. This is the same as the length property for arrays.
Copy

clear()

Clears the map. This will remove all the keys and values from the map.
Copy

delete()

Deletes the key/value pair from the map. If the key does not exist in the map, it will do nothing.
Copy
Copy

entries()

Returns an iterator object that contains the key/value pairs for each element in the map.
Copy

forEach()

Calls a function for each key/value pair in the map. The function is called with the value, key and the map itself as arguments.
Copy

get()

Returns the value associated with the key. If the key does not exist in the map, it will return undefined.

Usage

Copy
Copy
Copy

Example

Copy
Copy
Copy
Copy
Copy

has()

Returns true if the key exists in the map, otherwise it will return false.
Copy
Copy

keys()

Returns an iterator object that contains the keys for each element in the map.
Copy

path()

Retrieves the data hashed specified by the dot path.

Usage

Copy

Example

Copy
Copy
Copy

set()

Returns an iterator object that contains the keys for each element in the map.
Copy
Copy

values()

Returns an iterator object that contains the values for each element in the map.
Copy

withArgs()

Nest extension that parses CLI arguments and sets them in the nest.
Copy

withFormData()

Nest extension that parses form data and sets them in the nest.
Copy

withPath()

Nest extension that parses a path string with CRUD.
Copy
Copy
Copy
Copy
Copy
Copy
Copy
Copy

withQuery()

Nest extension that parses query data and sets them in the nest.
Copy