Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Manuel Spigolon <[email protected]>
  • Loading branch information
dwickern and Eomm authored Sep 22, 2022
1 parent 5a083e3 commit 934be7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ module.exports = fp(plugin, {
```

#### Encapsulate
You can optionally keep the plugin encapsulated, which is the default behavior if you weren't using `fastify-plugin`.

By default, `fastify-plugin` breaks the [encapsulation](https://github.com/fastify/fastify/blob/HEAD/docs/Reference/Encapsulation.md) but you can optionally keep the plugin encapsulated.
This allows you to set the plugin's name and validate its dependencies without making the plugin accessible.
Read more about encapsulation [here](https://github.com/fastify/fastify/blob/main/docs/Reference/Encapsulation.md).
```js
const fp = require('fastify-plugin')

Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ test('should accept an option to encapsulate', t => {
}))

fastify.ready(err => {
t.notOk(err)
t.error(err)
t.ok(fastify.hasDecorator('accessible'))
t.ok(fastify.hasDecorator('alsoAccessible'))
t.notOk(fastify.hasDecorator('encapsulated'))
Expand Down

0 comments on commit 934be7b

Please sign in to comment.