@promptbook/pdf 0.78.2 → 0.78.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
20
20
|
*
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.78.
|
|
23
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.78.2';
|
|
24
24
|
/**
|
|
25
25
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
26
26
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3613,20 +3613,32 @@ function extractVariablesFromScript(script) {
|
|
|
3613
3613
|
if (!(error instanceof ReferenceError)) {
|
|
3614
3614
|
throw error;
|
|
3615
3615
|
}
|
|
3616
|
-
var undefinedName = error.message.split(' ')[0];
|
|
3617
3616
|
/*
|
|
3618
3617
|
Note: Parsing the error
|
|
3618
|
+
🌟 Most devices:
|
|
3619
3619
|
[PipelineUrlError: thing is not defined]
|
|
3620
|
+
|
|
3621
|
+
🍏 iPhone`s Safari:
|
|
3622
|
+
[PipelineUrlError: Can't find variable: thing]
|
|
3620
3623
|
*/
|
|
3621
|
-
|
|
3624
|
+
var variableName = undefined;
|
|
3625
|
+
if (error.message.startsWith("Can't")) {
|
|
3626
|
+
// 🍏 Case
|
|
3627
|
+
variableName = error.message.split(' ').pop();
|
|
3628
|
+
}
|
|
3629
|
+
else {
|
|
3630
|
+
// 🌟 Case
|
|
3631
|
+
variableName = error.message.split(' ').shift();
|
|
3632
|
+
}
|
|
3633
|
+
if (variableName === undefined) {
|
|
3622
3634
|
throw error;
|
|
3623
3635
|
}
|
|
3624
|
-
if (script.includes(
|
|
3625
|
-
script = "const ".concat(
|
|
3636
|
+
if (script.includes(variableName + '(')) {
|
|
3637
|
+
script = "const ".concat(variableName, " = ()=>'';") + script;
|
|
3626
3638
|
}
|
|
3627
3639
|
else {
|
|
3628
|
-
variables.add(
|
|
3629
|
-
script = "const ".concat(
|
|
3640
|
+
variables.add(variableName);
|
|
3641
|
+
script = "const ".concat(variableName, " = '';") + script;
|
|
3630
3642
|
}
|
|
3631
3643
|
}
|
|
3632
3644
|
}
|