From a16d4c0c998852bf4fd5df2451960c4203a49a6c Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Tue, 17 Oct 2023 17:19:36 +0100 Subject: [PATCH] refactor(index): use `TypeError` over `Error` --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ac3ce2a..d68be26 100644 --- a/index.js +++ b/index.js @@ -95,7 +95,7 @@ function chooseAjvInstance (defaultInstance, ajvOpts) { } else if (typeof ajvOpts === 'object' && typeof ajvOpts.customOptions === 'function') { const ajv = ajvOpts.customOptions(getDefaultInstance()) if (!(ajv instanceof Ajv)) { - throw new Error('customOptions function must return an instance of Ajv') + throw new TypeError('customOptions function must return an instance of Ajv') } return ajv }