Skip to content

Commit

Permalink
Merge 65023bc into e7ba0b9
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarvspr committed Oct 28, 2022
2 parents e7ba0b9 + 65023bc commit ce804c1
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 189 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 ce804c1

Please sign in to comment.