@ethisyscore/vite-plugin 1.113.0 → 1.114.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/dist/index.js CHANGED
@@ -18,12 +18,6 @@ function toJsonPointer(path) {
18
18
  }).join("/");
19
19
  }
20
20
  function extractOffender(doc, issue) {
21
- if (issue.code === "invalid_value" || issue.code === "invalid_enum_value") {
22
- const received = issue.received;
23
- if (typeof received === "string") {
24
- return received;
25
- }
26
- }
27
21
  let cur = doc;
28
22
  for (const seg of issue.path) {
29
23
  if (cur === null || cur === void 0) {
@@ -31,6 +25,15 @@ function extractOffender(doc, issue) {
31
25
  }
32
26
  cur = cur[seg];
33
27
  }
28
+ if (issue.code === "invalid_value" || issue.code === "invalid_enum_value") {
29
+ const received = issue.received;
30
+ if (typeof received === "string") {
31
+ return received;
32
+ }
33
+ if (typeof cur === "string") {
34
+ return cur;
35
+ }
36
+ }
34
37
  if (cur && typeof cur === "object" && !Array.isArray(cur)) {
35
38
  const keys = Object.keys(cur);
36
39
  if (keys.length === 1 && !KNOWN_OPERATOR_SET.has(keys[0])) {