Skip to content

Commit

Permalink
docs(dependency-selectors): fix Arborist example in docs (npm#5328)
Browse files Browse the repository at this point in the history
* [dependency-selectors] fix example in docs

* Add async to the function declaration because awaits are used
  • Loading branch information
kyle-west authored Aug 24, 2022
1 parent 645c680 commit 414667a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/using-npm/dependency-selectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const arb = new Arborist({})

```js
// root-level
arb.loadActual((tree) => {
arb.loadActual().then(async (tree) => {
// query all production dependencies
const results = await tree.querySelectorAll('.prod')
console.log(results)
Expand All @@ -153,7 +153,7 @@ arb.loadActual((tree) => {

```js
// iterative
arb.loadActual((tree) => {
arb.loadActual().then(async (tree) => {
// query for the deduped version of react
const results = await tree.querySelectorAll('#react:not(:deduped)')
// query the deduped react for git deps
Expand Down

0 comments on commit 414667a

Please sign in to comment.