mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Version bump 2.0.1 and Fix db function validation
This commit is contained in:
		
							parent
							
								
									dc9c307663
								
							
						
					
					
						commit
						d4525ad5ca
					
				@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "audiobookshelf-client",
 | 
					  "name": "audiobookshelf-client",
 | 
				
			||||||
  "version": "2.0.0",
 | 
					  "version": "2.0.1",
 | 
				
			||||||
  "description": "Audiobook manager and player",
 | 
					  "description": "Audiobook manager and player",
 | 
				
			||||||
  "main": "index.js",
 | 
					  "main": "index.js",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "audiobookshelf",
 | 
					  "name": "audiobookshelf",
 | 
				
			||||||
  "version": "2.0.0",
 | 
					  "version": "2.0.1",
 | 
				
			||||||
  "description": "Self-hosted audiobook server for managing and playing audiobooks",
 | 
					  "description": "Self-hosted audiobook server for managing and playing audiobooks",
 | 
				
			||||||
  "main": "index.js",
 | 
					  "main": "index.js",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
 | 
				
			|||||||
@ -53,10 +53,11 @@ const validateObject = (o) => {
 | 
				
			|||||||
const validateFunction = (f) => {
 | 
					const validateFunction = (f) => {
 | 
				
			||||||
    if (typeof f !== "function") {
 | 
					    if (typeof f !== "function") {
 | 
				
			||||||
        throw new TypeError("Not a 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;
 | 
					    return f;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user