Parse a UCAN policy selector into segments.
Consumes the whole string and throws a TypeError on anything that is not valid selector syntax. Supported forms:
TypeError
.
.name
[A-Za-z_][A-Za-z0-9_]*
["any string"]
[]
[n]
[-n]
[a:b]
[a:]
[:b]
?
A selector MUST start with . and MUST NOT contain ...
..
https://github.com/ucan-wg/delegation#selectors
Parse a UCAN policy selector into segments.
Consumes the whole string and throws a
TypeErroron anything that is not valid selector syntax. Supported forms:.identity.namedotted field name, where name matches[A-Za-z_][A-Za-z0-9_]*["any string"]unambiguous field name, with JSON string escapes[]collection values[n],[-n]list index[a:b],[a:],[:b]list slice?on any segment (repeated?collapse into one)A selector MUST start with
.and MUST NOT contain...