| Conditions | 2 |
| Total Lines | 8 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from benedict.core.keylists import keylists |
||
| 5 | def keypaths(d, separator=".", indexes=False): |
||
| 6 | separator = separator or "." |
||
| 7 | if not type_util.is_string(separator): |
||
| 8 | raise ValueError("separator argument must be a (non-empty) string.") |
||
| 9 | kls = keylists(d, indexes=indexes) |
||
| 10 | kps = [separator.join([f"{key}" for key in kl]) for kl in kls] |
||
| 11 | kps.sort() |
||
| 12 | return kps |
||
| 13 |