keq 5.2.0 → 5.2.2

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.mjs CHANGED
@@ -1078,7 +1078,14 @@ function fixContentType(contentType) {
1078
1078
  function getLocationId(depth = 0) {
1079
1079
  const err = /* @__PURE__ */ new Error();
1080
1080
  if (!err.stack) return "";
1081
- return err.stack.split("\n")[depth + 2].trim();
1081
+ const lines = err.stack.split("\n");
1082
+ const offset = depth + 2;
1083
+ if (lines[offset]) return lines[offset].trim();
1084
+ for (let i = lines.length - 1; i >= 0; i--) {
1085
+ const line = lines[i].trim();
1086
+ if (line) return line;
1087
+ }
1088
+ return "";
1082
1089
  }
1083
1090
  //#endregion
1084
1091
  //#region src/request/utils/resolve-with.ts