Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodrig committed May 26, 2021
1 parent b7f0beb commit 321ca84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let path = require('doc-path');

* `document` - `Object` - A JSON document that will be iterated over.
* `key` - `String` - A path to the existing key whose value will be returned.
* Note: If your key has a dot in it (eg. `a.b`) then be sure to escape the dot with a blackslash (eg. `a\\.b`).

If the key does not exist, `undefined` is returned.

Expand Down Expand Up @@ -81,6 +82,7 @@ console.log(path.evaluatePath(document, 'Features.packages.name'));

* `document` - `Object` - A JSON document that will be iterated over.
* `key` - `String` - A path to the existing key whose value will be set.
* Note: If your key has a dot in it (eg. `a.b`) then be sure to escape the dot with a blackslash (eg. `a\\.b`).
* `value` - `*` - The value that will be set at the given key.

If the key does not exist, then the object will be built up to have that path.
Expand Down Expand Up @@ -166,6 +168,7 @@ Lines : 100% ( 29/29 )

## Features

- Supports keys with escaped `.` characters (as of v3.0.0)
- Supports nested paths
- Including keys of objects inside arrays! (as of v2.0.0)
- Same common path specification as other programs such as MongoDB

0 comments on commit 321ca84

Please sign in to comment.