Skip to content

Commit

Permalink
specify type requirements in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
janl authored Oct 31, 2021
1 parent 747ee17 commit 00c9afe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsonpointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function compilePointer (pointer) {
} else if (Array.isArray(pointer)) {
for (const part of pointer) {
if (typeof part !== 'string' && typeof part !== 'number') {
throw new Error('Invalid JSON pointer.')
throw new Error('Invalid JSON pointer. Must be of type string or number.')
}
}
return pointer
Expand Down

0 comments on commit 00c9afe

Please # to comment.