mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	
		
			
	
	
		
			13 lines
		
	
	
		
			345 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			13 lines
		
	
	
		
			345 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
|  | import ScriptContext from "./script_context"; | ||
|  | 
 | ||
|  | async function executeBundle(bundle) { | ||
|  |     const apiContext = ScriptContext(bundle.note, bundle.allNotes); | ||
|  | 
 | ||
|  |     return await (function () { | ||
|  |         return eval(`const apiContext = this; (async function() { ${bundle.script}\r\n})()`); | ||
|  |     }.call(apiContext)); | ||
|  | } | ||
|  | 
 | ||
|  | export default { | ||
|  |     executeBundle | ||
|  | } |