countArrayPlaceholders
Counts the number of array placeholders in a path.
Presentation
function countArrayPlaceholders (path: string): number;Returns
number -Number of $ placeholders in the path
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | The path to analyze |
Example usage
countArrayPlaceholders ('orders.$.items.$.quantity')
// 2
countArrayPlaceholders ('items.$.name')
// 1
countArrayPlaceholders ('simpleField')
// 0