Skip to content

Commit

Permalink
Fix: nodenext resolution fastify#198
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarvspr committed Oct 27, 2022
1 parent e7ba0b9 commit 6aae40c
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 153 deletions.
5 changes: 3 additions & 2 deletions src/ObjectSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ const ObjectSchema = ({ schema = initialState, ...options } = {}) => {
* @param {string} id - an #id
**/
id: id => {
if (!id)
if (!id) {
throw new FluentSchemaError(
`id should not be an empty fragment <#> or an empty string <> (e.g. #myId)`
'id should not be an empty fragment <#> or an empty string <> (e.g. #myId)'
)
}
return options.factory({ schema: { ...schema, $id: id }, ...options })
},
/**
Expand Down
2 changes: 1 addition & 1 deletion src/ObjectSchema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('ObjectSchema', () => {
.valueOf()
).toEqual({
$id: id,
properties: {'prop': {}},
properties: { prop: {} },
type: 'object'
})
})
Expand Down
Loading

0 comments on commit 6aae40c

Please sign in to comment.