Add comments

This commit is contained in:
Adria Navarro 2024-02-07 15:18:17 +01:00
parent ec5e533063
commit b8ebeff71c
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,11 @@ class ScriptRunner {
}) })
if (parseBson) { if (parseBson) {
// If we need to parse bson, we follow the next steps:
// 1. Serialise the data from potential BSON to buffer before passing it to the isolate
// 2. Deserialise the data within the isolate, to get the original data
// 3. Process script
// 4. Stringify and parse result in order to convert the result from BSON to json
script = `return JSON.parse(JSON.stringify((function(){data=deserialize(data).data;${script}})()));` script = `return JSON.parse(JSON.stringify((function(){data=deserialize(data).data;${script}})()));`
} }