# json_pointer 0.1.0

A simple library for creating and using json-pointer (See [rfc6901:https://tools.ietf.org/html/rfc6901]).




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'json_pointer:0.1.0'
```
Published: 2019-09-28T03:34:35.090806Z
Expected archive SHA-256: fcac1865aea4e4e3b44cf601b418f131debe994249926cc774ff440e81eef4eb

Available in cache; verification: upstream_checksum
## Direct dependencies

## Package README (untrusted upstream documentation)
# JSON Pointer

A simple library for creating and using json-pointer (See [rfc6901](https://tools.ietf.org/html/rfc6901)).

## Examples

```Dart
  // Json Pointer Manipulation
  compose(['one', 'two']); // '/one/two'
  split('/one/two'); // ['one', 'two']
  parent('/one/two'); // '/one'
  append('/one', 'two'); // '/one/two'
  isValid('/one/two'); // true

  // Json Pointer Part manipulation
  escape('one/two'); // 'one~1two'
  unescape('one~1two'); // 'one/two'

  // Get and Set values in a json object
  var obj = [
    {'foo': 'bar'}
  ]

  get$('/0/foo', obj); // 'bar'
  set$('/0/foo', obj, 'baz'); // [{'foo': 'baz'}]
  contains('/0/foo', obj); // true
```

## Escaping Examples

```Dart
  // Compose escapes parts
  compose(['one/two', 'three']); // '/one~1two/three'

  // Append escapes the added part
  append('/one', 'two/three'); // '/one/two~1three'

  // Split unescapes parts
  split('/one~1two/three'); // ['one/two', 'three']
```

## Traversal

The library is only able to traverse through objects of type `Map` and `List`.  Functions will generally throw `BadRouteError` when attempting to traverse other types.  `contains` will return false.

```Dart
class Point {
  Point(this.x, this.y);
  int x;
  int y;
}

contains('/x', Point(0, 0)) // false
contains('', Point(0, 0)) // true, this is ok as Point is never traversed 
```


## Changelog
## 0.0.0

Initial version

## 0.0.1

Documentation and project fomatting changes

## 0.0.2

Documentation updates

## 0.1.0

Documentation updates






 
