From 02d4cac0d924d0885fcbcd141954ed65c5d0c6c1 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Fri, 19 Aug 2022 10:36:52 -0600 Subject: [PATCH 1/2] [dependency-selectors] fix Arborist example --- content/cli/v8/using-npm/dependency-selectors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/cli/v8/using-npm/dependency-selectors.md b/content/cli/v8/using-npm/dependency-selectors.md index f6d212b8476..4283537c6aa 100644 --- a/content/cli/v8/using-npm/dependency-selectors.md +++ b/content/cli/v8/using-npm/dependency-selectors.md @@ -152,7 +152,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) @@ -161,7 +161,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 c0b3dfcbd661ccbcb0b93cd554ca17cd5d781229 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Fri, 19 Aug 2022 10:46:05 -0600 Subject: [PATCH 2/2] Add async to the function declaration because awaits are used --- content/cli/v8/using-npm/dependency-selectors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/cli/v8/using-npm/dependency-selectors.md b/content/cli/v8/using-npm/dependency-selectors.md index 4283537c6aa..7684b74eb4e 100644 --- a/content/cli/v8/using-npm/dependency-selectors.md +++ b/content/cli/v8/using-npm/dependency-selectors.md @@ -152,7 +152,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) @@ -161,7 +161,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