Version bump 2.0.1 and Fix db function validation

This commit is contained in:
advplyr 2022-04-22 12:44:24 -05:00
parent dc9c307663
commit d4525ad5ca
3 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "audiobookshelf-client",
"version": "2.0.0",
"version": "2.0.1",
"description": "Audiobook manager and player",
"main": "index.js",
"scripts": {

View File

@ -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": {

View File

@ -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;
}