![]() |
VOOZH | about |
JsonNodeExtensions Class
Namespace: Json.Logic
Inheritance: JsonNodeExtensions 🡒 object
Provides fuzzy-logic extensions for System.Text.Json.Nodes.JsonNode values.
Flattens an array into its root components (removes intermediate arrays).
1
public static IEnumerable<JsonNode> Flatten(this JsonNode root)
| Parameter | Type | Description |
|---|---|---|
| root | JsonNode | The element. |
Returns a single array with all of the intermediate arrays removed.
Determines whether a value can be considered as true.
1
public static bool IsTruthy(this JsonNode node)
| Parameter | Type | Description |
|---|---|---|
| node | JsonNode | The element. |
true if the value is:
true
1
`false` otherwise
Provides loose equality comparison of System.Text.Json.Nodes.JsonNode values.
1
public static bool LooseEquals(this JsonNode a, JsonNode b)
| Parameter | Type | Description |
|---|---|---|
| a | JsonNode | The first value. |
| b | JsonNode | The second value. |
true if the values are loosely equal; false otherwise.
Adapted from @marvindv/jsonlogic_rs.
Provides a loose-cast to a number.
1
public static decimal? Numberify(this JsonNode node)
| Parameter | Type | Description |
|---|---|---|
| node | JsonNode | The node. |
A string representation of the value as follows:
Provides a loose-cast to a string.
1
public static string Stringify(this JsonNode node)
| Parameter | Type | Description |
|---|---|---|
| node | JsonNode | The node. |
A string representation of the value as follows:
A new version of content is available.