JsonPath<T>.parsed constructor

JsonPath<T>.parsed(
  1. String value, {
  2. JsonPath? relativeTo,
})

Implementation

factory JsonPath.parsed(String value, {JsonPath? relativeTo}) {
  final _segments = _parsePath(value);
  final path = JsonPath<T>._(List.unmodifiable(_segments), _toPathName(_segments));
  if (relativeTo != null) {
    return path.relativize<T>(relativeTo);
  } else {
    return path;
  }
}