From 414667a1e6d7d7a3ab0cb64704c3aa696eae8715 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Wed, 24 Aug 2022 11:19:41 -0600 Subject: [PATCH] docs(dependency-selectors): fix Arborist example in docs (#5328) * [dependency-selectors] fix example in docs * Add async to the function declaration because awaits are used --- docs/content/using-npm/dependency-selectors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/using-npm/dependency-selectors.md b/docs/content/using-npm/dependency-selectors.md index c96057c798ef5..a9433a537f985 100644 --- a/docs/content/using-npm/dependency-selectors.md +++ b/docs/content/using-npm/dependency-selectors.md @@ -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) @@ -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