Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle West <kyle-west@users.noreply.github.com>2022-08-24 20:19:41 +0300
committerGitHub <noreply@github.com>2022-08-24 20:19:41 +0300
commit414667a1e6d7d7a3ab0cb64704c3aa696eae8715 (patch)
treef6abb7ad75e50fdd6be205b6b2d1ff9efa343056
parent645c6804c09014b96c2d1eff191b174d12a2b7c0 (diff)
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
-rw-r--r--docs/content/using-npm/dependency-selectors.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/content/using-npm/dependency-selectors.md b/docs/content/using-npm/dependency-selectors.md
index c96057c79..a9433a537 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