@promptbook/core 0.56.0-3 → 0.56.0

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/umd/index.umd.js CHANGED
@@ -454,7 +454,7 @@
454
454
  /**
455
455
  * The version of the Promptbook library
456
456
  */
457
- var PROMPTBOOK_VERSION = '0.56.0-2';
457
+ var PROMPTBOOK_VERSION = '0.56.0-4';
458
458
 
459
459
  /**
460
460
  * Parses the template and returns the list of all parameter names
@@ -3486,7 +3486,7 @@
3486
3486
  *
3487
3487
  * @param promptbookSourcesPromiseOrFactory
3488
3488
  * @returns PromptbookLibrary
3489
- * @private Just internal tool for other constructor functions
3489
+ * @deprecated Do not use, it will became internal tool for other constructor functions
3490
3490
  */
3491
3491
  function createPromptbookLibraryFromPromise(promptbookSourcesPromiseOrFactory) {
3492
3492
  var library;
@@ -3663,61 +3663,6 @@
3663
3663
  };
3664
3664
  }
3665
3665
 
3666
- /**
3667
- * Detects if the code is running in a browser environment in main thread (Not in a web worker)
3668
- */
3669
- new Function("\n try {\n return this === window;\n } catch (e) {\n return false;\n }\n");
3670
- /**
3671
- * Detects if the code is running in a Node.js environment
3672
- */
3673
- var isRunningInNode = new Function("\n try {\n return this === global;\n } catch (e) {\n return false;\n }\n");
3674
- /**
3675
- * Detects if the code is running in a web worker
3676
- */
3677
- new Function("\n try {\n if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {\n return true;\n } else {\n return false;\n }\n } catch (e) {\n return false;\n }\n");
3678
-
3679
- /**
3680
- * Returns the same value that is passed as argument.
3681
- * No side effects.
3682
- *
3683
- * Note: It can be usefull for leveling indentation
3684
- *
3685
- * @param value any values
3686
- * @returns the same values
3687
- */
3688
- function just(value) {
3689
- if (value === undefined) {
3690
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3691
- return undefined;
3692
- }
3693
- return value;
3694
- }
3695
-
3696
- /**
3697
- * Just testing imports and compatibility
3698
- */
3699
- function justTestFsImport() {
3700
- return __awaiter(this, void 0, void 0, function () {
3701
- var files;
3702
- return __generator(this, function (_a) {
3703
- switch (_a.label) {
3704
- case 0:
3705
- if (!isRunningInNode()) {
3706
- throw new Error('Function `testFiles` can only be run in Node.js environment because it reads the file system.');
3707
- }
3708
- return [4 /*yield*/, require(just('glob-promise'))('/**/*')];
3709
- case 1:
3710
- files = _a.sent();
3711
- console.info('testFiles', { files: files });
3712
- return [2 /*return*/];
3713
- }
3714
- });
3715
- });
3716
- }
3717
- /**
3718
- * TODO: !!! Remove this file
3719
- */
3720
-
3721
3666
  /**
3722
3667
  * Format either small or big number
3723
3668
  *
@@ -3738,6 +3683,23 @@
3738
3683
  return value.toString();
3739
3684
  }
3740
3685
 
3686
+ /**
3687
+ * Returns the same value that is passed as argument.
3688
+ * No side effects.
3689
+ *
3690
+ * Note: It can be usefull for leveling indentation
3691
+ *
3692
+ * @param value any values
3693
+ * @returns the same values
3694
+ */
3695
+ function just(value) {
3696
+ if (value === undefined) {
3697
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3698
+ return undefined;
3699
+ }
3700
+ return value;
3701
+ }
3702
+
3741
3703
  /**
3742
3704
  * Create a markdown table from a 2D array of strings
3743
3705
  *
@@ -4041,12 +4003,12 @@
4041
4003
  exports.assertsExecutionSuccessful = assertsExecutionSuccessful;
4042
4004
  exports.checkExpectations = checkExpectations;
4043
4005
  exports.createPromptbookExecutor = createPromptbookExecutor;
4006
+ exports.createPromptbookLibraryFromPromise = createPromptbookLibraryFromPromise;
4044
4007
  exports.createPromptbookLibraryFromSources = createPromptbookLibraryFromSources;
4045
4008
  exports.createPromptbookLibraryFromUrl = createPromptbookLibraryFromUrl;
4046
4009
  exports.createPromptbookSublibrary = createPromptbookSublibrary;
4047
4010
  exports.executionReportJsonToString = executionReportJsonToString;
4048
4011
  exports.isPassingExpectations = isPassingExpectations;
4049
- exports.justTestFsImport = justTestFsImport;
4050
4012
  exports.prettifyPromptbookString = prettifyPromptbookString;
4051
4013
  exports.promptbookJsonToString = promptbookJsonToString;
4052
4014
  exports.promptbookStringToJson = promptbookStringToJson;