episoda 0.2.12 → 0.2.13

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/dist/index.js CHANGED
@@ -1646,9 +1646,19 @@ var require_version = __commonJS({
1646
1646
  exports2.VERSION = void 0;
1647
1647
  var fs_1 = require("fs");
1648
1648
  var path_1 = require("path");
1649
- var packageJsonPath = (0, path_1.join)(__dirname, "..", "package.json");
1650
- var packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, "utf-8"));
1651
- exports2.VERSION = packageJson.version;
1649
+ var FALLBACK_VERSION = "0.1.11";
1650
+ function getVersion() {
1651
+ try {
1652
+ const packageJsonPath = (0, path_1.join)(__dirname, "..", "package.json");
1653
+ if ((0, fs_1.existsSync)(packageJsonPath)) {
1654
+ const packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, "utf-8"));
1655
+ return packageJson.version;
1656
+ }
1657
+ } catch {
1658
+ }
1659
+ return FALLBACK_VERSION;
1660
+ }
1661
+ exports2.VERSION = getVersion();
1652
1662
  }
1653
1663
  });
1654
1664