These block helpers allow for querying and parsing paths.
- Helpers.Path.GetKeyValuePairMatches
- Helpers.Path.HasExtension
- Helpers.Path.HasKeyValuePairMatch
- Helpers.Path.HasSegment
- Helpers.Path.ParseUnitSlug
| Summary | Given path, determine if key and value exist |
| Returns | Returns matching records |
| Remarks | |
| Parameters | |
| path | Path to pull info from |
| keyValuePairs | List of key value pairs |
| delimiter | Delimiter to parse path with, defaults to / |
| offset | Offset to start key/value pair loading, defaults to 0 |
Context
{
"value": "/search/inventory/type/Snowmobile/brand/Arctic%20Cat",
"match1": {
"id": 1,
"key": "type",
"value": "Snowmobile"
},
"match2": {
"name": "test",
"key": "type",
"values": [
"ATV",
"Snowmobile",
"Bike"
]
},
"match3": [
{
"key": "type",
"value": "Snowmobile"
},
{
"specialThing": "thing",
"key": "brand",
"values": [
"Yamaha",
"Honda"
]
}
]
}Usage
Returns
<strong>result:</strong>
<ul>
<li>Key: id, Value: 1</li>
<li>Key: key, Value: type</li>
<li>Key: value, Value: Snowmobile</li>
</ul>
<ul>
<li>Failed to find match</li>
</ul>
<ul>
<li>Failed to find match</li>
</ul>
<ul>
<li>Key: id, Value: 1</li>
<li>Key: key, Value: type</li>
<li>Key: value, Value: Snowmobile</li>
</ul>
<ul>
<li>Key: name, Value: test</li>
<li>Key: key, Value: type</li>
<li>Key: values, Value: System.Collections.Generic.List`1[System.Object]</li>
</ul>
<ul>
<li>Key: key, Value: type</li>
<li>Key: value, Value: Snowmobile</li>
</ul>| Summary | Given path, get whether or not it contains a file extension |
| Returns | Whether or not it contains a file extension |
| Remarks | |
| Parameters | |
| path | Path to pull info from |
| extension | Extension to look for |
Context
{
"value": "https://github.com/arinet/HandlebarDocs/blob/master/customHelpers.md"
}Usage
Returns
<strong>result:</strong>
<strong>True</strong>
<strong>False</strong>| Summary | Given path, determine if key and value exist |
| Returns | Whether or not key and value exist |
| Remarks | |
| Parameters | |
| path | Path to pull info from |
| key | Key to look for |
| value | Value to look for |
| delimiter | Delimiter to parse path with, defaults to / |
| offset | Offset to start key/value pair loading, defaults to 0 |
Context
{
"value": "/search/inventory/type/Snowmobile/brand/Arctic%20Cat"
}Usage
Returns
<strong>result:</strong>
<strong>True</strong>
<strong>False</strong>
<strong>False</strong>
<strong>True</strong>| Summary | Given path, determine if segment exists |
| Returns | Whether or not segment exists |
| Remarks | |
| Parameters | |
| path | Path to pull info from |
| segment | Segment to look for |
| delimiter | Delimiter to parse path with, defaults to / |
Context
{
"value": "https://github.com/arinet/HandlebarDocs/blob/master/customHelpers.md"
}Usage
Returns
<strong>result:</strong>
<strong>True</strong>
<strong>False</strong>
<strong>False</strong>| Summary | Given a bigInteger url slug, parse out the values |
| Returns | Object representing parsed values |
| Remarks | |
| Parameters | |
| path | Path to pull info from |
Context
{
"value1": "https://www.rjsportandcycle.com/new-models/arctic-cat-3",
"value2": "https://www.rjsportandcycle.com/new-models/arctic-cat-snowmobile-trail-1573876204375371459592195"
}Usage
Returns
<strong>result:</strong>
<ul>
<li>Key: Id, Value: 0</li>
<li>Key: IsUnitInventory, Value: False</li>
<li>Key: ProductOwnerId, Value: 3</li>
<li>Key: TypeId, Value: 0</li>
<li>Key: ClassId, Value: 0</li>
</ul>
<ul>
<li>Key: Id, Value: 0</li>
<li>Key: IsUnitInventory, Value: False</li>
<li>Key: ProductOwnerId, Value: 3</li>
<li>Key: TypeId, Value: 1507</li>
<li>Key: ClassId, Value: 85320</li>
</ul>
<ul>
<li>Key: Id, Value: 0</li>
<li>Key: IsUnitInventory, Value: False</li>
<li>Key: ProductOwnerId, Value: 40</li>
<li>Key: TypeId, Value: 1513</li>
<li>Key: ClassId, Value: 0</li>
</ul>
<ul>
<li>Failure to parse</li>
</ul>