Skip to content

Commit 29cd16f

Browse files
author
Philipp Alferov
committed
Fix example
1 parent 626bc50 commit 29cd16f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "array-to-tree",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "Convert a plain array of nodes (with pointers to parent nodes) to a tree",
55
"main": "index.js",
66
"scripts": {

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Solves a problem with conversion of retrieved from a database sets of data to a
1010
$ npm install --save array-to-tree
1111
```
1212

13-
## Usage
13+
## Basic Usage
1414

1515
```js
1616
var arrayToTree = require('array-to-tree');
@@ -33,7 +33,7 @@ var navigation = [{
3333
parent_id: null
3434
}];
3535

36-
var navigationTree = arrayToTree(navigation);
36+
var navigationTree = arrayToTree({ data: navigation });
3737

3838
/*
3939
* Output:

0 commit comments

Comments
 (0)