From 00c9afe0b7dbe519acffeef831f637a94b4962b8 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Sun, 31 Oct 2021 18:09:57 +0100 Subject: [PATCH] specify type requirements in error message --- jsonpointer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonpointer.js b/jsonpointer.js index d17f60a..3f6f353 100644 --- a/jsonpointer.js +++ b/jsonpointer.js @@ -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