Skip to main content

Module value

Module value 

Source
Expand description

Helpers for building and reading LinoValue objects.

Links Notation objects keep their keys in insertion order, which is what makes entity tags reproducible across implementations, so every helper here preserves that order.

Functionsยง

array
Build an array from its items.
as_array
The items of a value when it is an array.
as_object
The members of a value when it is an object.
as_str
The text of a value when it is a string.
boolean
A boolean value.
compare
Compare two values in a total order that works across every scalar type.
format_float
Format a float the way JSON does: whole numbers keep no fraction.
get
Read a member of an object, or None when it is absent or the value is not an object.
has
Whether an object carries a member.
int
An integer value.
merge
Merge the members of patch into base, as PATCH does.
object
Build an object from its members, keeping them in the given order.
set
Set a member, replacing it in place when it is already present so that the order of the other members is untouched.
string
A string value.
to_query_text
Render a value the way a query string or a path segment spells it.
with
An object with one member replaced or appended, leaving the original untouched.