mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	support passing functions to the backend as parameters
This commit is contained in:
		| @@ -19,7 +19,14 @@ async function executeScript(dataKey, script, params) { | ||||
| } | ||||
|  | ||||
| function getParams(params) { | ||||
|     return params.map(p => JSON.stringify(p)).join(","); | ||||
|     return params.map(p => { | ||||
|         if (typeof p === "string" && p.startsWith("!@#Function: ")) { | ||||
|             return p.substr(13); | ||||
|         } | ||||
|         else { | ||||
|             return JSON.stringify(p); | ||||
|         } | ||||
|     }).join(","); | ||||
| } | ||||
|  | ||||
| module.exports = { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user