matchTarget static method
Implementation
static Target? matchTarget(Uri uri) => switch ((uri.pathSegments)) {
[var type] => Target(type),
[var type, var id] => ResourceTarget(type, id),
[var type, var id, var rel] => RelatedTarget(type, id, rel),
[var type, var id, 'relationships', var rel] =>
RelationshipTarget(type, id, rel),
_ => null
};