Documentation
    Preparing search index...

    Function parseSelector

    • 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:

      • . identity
      • .name dotted 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
      • a trailing ? on any segment (repeated ? collapse into one)

      A selector MUST start with . and MUST NOT contain ...

      Parameters

      • selector: string

      Returns SelectorSegment[]