@promptbook/pdf 0.78.2 → 0.78.4

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->
2
2
 
3
- # ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) Promptbook
3
+ # Promptbook
4
4
 
5
5
 
6
6
 
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- ## New Features
17
+ ## New Features
18
18
 
19
19
  - 💙 Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
20
20
  - 🖤 Run books from CLI - `npx ptbk run path/to/your/book`
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.1';
23
+ var PROMPTBOOK_ENGINE_VERSION = '0.78.3';
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
- if (!undefinedName) {
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(undefinedName + '(')) {
3625
- script = "const ".concat(undefinedName, " = ()=>'';") + script;
3636
+ if (script.includes(variableName + '(')) {
3637
+ script = "const ".concat(variableName, " = ()=>'';") + script;
3626
3638
  }
3627
3639
  else {
3628
- variables.add(undefinedName);
3629
- script = "const ".concat(undefinedName, " = '';") + script;
3640
+ variables.add(variableName);
3641
+ script = "const ".concat(variableName, " = '';") + script;
3630
3642
  }
3631
3643
  }
3632
3644
  }