From d4525ad5ca3153b765bdbb730147a1c308eb2882 Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 22 Apr 2022 12:44:24 -0500 Subject: [PATCH] Version bump 2.0.1 and Fix db function validation --- client/package.json | 2 +- package.json | 2 +- server/njodb/validators.js | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/package.json b/client/package.json index 44bf694d..d1328ea9 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "2.0.0", + "version": "2.0.1", "description": "Audiobook manager and player", "main": "index.js", "scripts": { diff --git a/package.json b/package.json index 4b27d5d5..801d6296 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf", - "version": "2.0.0", + "version": "2.0.1", "description": "Self-hosted audiobook server for managing and playing audiobooks", "main": "index.js", "scripts": { diff --git a/server/njodb/validators.js b/server/njodb/validators.js index 7b8a3224..16ea293c 100644 --- a/server/njodb/validators.js +++ b/server/njodb/validators.js @@ -53,10 +53,11 @@ const validateObject = (o) => { const validateFunction = (f) => { if (typeof f !== "function") { throw new TypeError("Not a function") - } else { - const fString = f.toString(); - if (/\s*function/.test(fString) && !/\W+return\W+/.test(fString)) throw new Error("Function must return a value"); } + // } else { + // const fString = f.toString(); + // if (/\s*function/.test(fString) && !/\W+return\W+/.test(fString)) throw new Error("Function must return a value"); + // } return f; }