getLeafPath
Gets the last segment (leaf) from a path.
Presentation
function getLeafPath (path: string): string;Returns
string -The last segment
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | The path to get leaf from |
Example usage
getLeafPath ('parent.child.grandchild')
// 'grandchild'
getLeafPath ('topLevel')
// 'topLevel'