@optique/git 0.9.0-dev.258 → 0.9.0-dev.262

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.cjs CHANGED
@@ -44,7 +44,9 @@ const METAVAR_BRANCH = "BRANCH";
44
44
  const METAVAR_TAG = "TAG";
45
45
  const METAVAR_REMOTE = "REMOTE";
46
46
  function getRepoDir(dirOption) {
47
- return dirOption ?? (typeof node_process.default !== "undefined" ? node_process.default.cwd() : ".");
47
+ if (dirOption != null) return dirOption;
48
+ if (typeof node_process.default !== "undefined" && typeof node_process.default.cwd === "function") return node_process.default.cwd();
49
+ throw new Error("Git parser requires a `dir` option in environments where `process.cwd()` is unavailable.");
48
50
  }
49
51
  function hasErrorCode(error, code) {
50
52
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
package/dist/index.js CHANGED
@@ -22,7 +22,9 @@ const METAVAR_BRANCH = "BRANCH";
22
22
  const METAVAR_TAG = "TAG";
23
23
  const METAVAR_REMOTE = "REMOTE";
24
24
  function getRepoDir(dirOption) {
25
- return dirOption ?? (typeof process !== "undefined" ? process.cwd() : ".");
25
+ if (dirOption != null) return dirOption;
26
+ if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd();
27
+ throw new Error("Git parser requires a `dir` option in environments where `process.cwd()` is unavailable.");
26
28
  }
27
29
  function hasErrorCode(error, code) {
28
30
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/git",
3
- "version": "0.9.0-dev.258+a42f88c2",
3
+ "version": "0.9.0-dev.262+82b91ad0",
4
4
  "description": "Git value parsers for Optique",
5
5
  "keywords": [
6
6
  "CLI",