DataPathModule
PackageReified.Data
Helpers for constructing, parsing, and rendering structured data paths.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| empty | DataPath.empty | The root structured data path. |
| name | DataPath.name name | Creates a one-segment path for a named source field. |
| index | DataPath.index index | Creates a one-segment path for a zero-based collection index. |
| appendName | DataPath.appendName name path | Appends a named source field segment to an input path. |
| appendIndex | DataPath.appendIndex index path | Appends a zero-based collection index segment to an input path. |
| ofSegments | DataPath.ofSegments segments | Creates a path from validated segments. |
| segments | DataPath.segments path | Returns the segments in an input path. |
| toString | DataPath.toString path | Renders a structured data path using names, dot separators, and bracketed indexes. |
| tryParse | DataPath.tryParse text | Attempts to parse a structured data path such as contacts[1].value. |
| parse | DataPath.parse text | Parses a structured data path or raises when the text is invalid. |
Creates a one-segment path for a named source field.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string |
Returns
DataPath
Creates a one-segment path for a zero-based collection index.
Parameters
| Name | Type | Description |
|---|---|---|
| index | int |
Returns
DataPath
Appends a named source field segment to an input path.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| path | DataPath |
Returns
DataPath
Appends a zero-based collection index segment to an input path.
Parameters
| Name | Type | Description |
|---|---|---|
| index | int | |
| path | DataPath |
Returns
DataPath
Creates a path from validated segments.
Parameters
| Name | Type | Description |
|---|---|---|
| segments | DataPathSegment seq |
Returns
DataPath
Returns the segments in an input path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | DataPath |
Returns
DataPathSegment list
Renders a structured data path using names, dot separators, and bracketed indexes.
Parameters
| Name | Type | Description |
|---|---|---|
| path | DataPath |
Returns
string
Attempts to parse a structured data path such as
contacts[1].value.Parameters
| Name | Type | Description |
|---|---|---|
| text | string |
Returns
DataPath option