From eab4d602f2c3c692499c9b89f1eb88f9ed1eb09b Mon Sep 17 00:00:00 2001 From: Kyle West Date: Fri, 19 Aug 2022 10:31:54 -0600 Subject: [PATCH 1/2] [dependency-selectors] fix example in docs --- 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..01165aa228d04 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((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((tree) => { // query for the deduped version of react const results = await tree.querySelectorAll('#react:not(:deduped)') // query the deduped react for git deps From e1c458162bec77e382ca0c392435b54855d174ed Mon Sep 17 00:00:00 2001 From: Kyle West Date: Fri, 19 Aug 2022 10:45:26 -0600 Subject: [PATCH 2/2] 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 01165aa228d04..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().then((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().then((tree) => { ```js // iterative -arb.loadActual().then((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