Skip to content

Commit

Permalink
fix: rename to hideEmptyNodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm committed Sep 22, 2022
1 parent dedf6a5 commit d899944
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const {

function fastifyOverview (fastify, options, next) {
const opts = Object.assign({
hideEmpty: false,
hideEmptyNodes: false,
addSource: false
}, options)

Expand Down Expand Up @@ -59,7 +59,7 @@ function fastifyOverview (fastify, options, next) {
throw new Error('Fastify must be in ready status to access the overview')
}

if (opts.hideEmpty) {
if (opts.hideEmptyNodes) {
const filterStructure = JSON.stringify(structure, (key, value) => {
switch (key) {
case 'decorators':
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ test('register', async t => {

test('hide empty', async t => {
const app = fastify()
await app.register(plugin, { hideEmpty: true })
await app.register(plugin, { hideEmptyNodes: true })

app.decorate('emptyObject', {})
app.decorate('emptyArray', [])
Expand Down

0 comments on commit d899944

Please sign in to comment.