@ai-sdk/provider-utils 4.0.10 → 4.0.11

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
@@ -503,7 +503,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
503
503
  }
504
504
 
505
505
  // src/version.ts
506
- var VERSION = true ? "4.0.10" : "0.0.0-test";
506
+ var VERSION = true ? "4.0.11" : "0.0.0-test";
507
507
 
508
508
  // src/get-from-api.ts
509
509
  var getOriginalFetch = () => globalThis.fetch;
@@ -2111,17 +2111,19 @@ function zodSchema(zodSchema2, options) {
2111
2111
  // src/validate-types.ts
2112
2112
  async function validateTypes({
2113
2113
  value,
2114
- schema
2114
+ schema,
2115
+ context
2115
2116
  }) {
2116
- const result = await safeValidateTypes({ value, schema });
2117
+ const result = await safeValidateTypes({ value, schema, context });
2117
2118
  if (!result.success) {
2118
- throw import_provider8.TypeValidationError.wrap({ value, cause: result.error });
2119
+ throw import_provider8.TypeValidationError.wrap({ value, cause: result.error, context });
2119
2120
  }
2120
2121
  return result.value;
2121
2122
  }
2122
2123
  async function safeValidateTypes({
2123
2124
  value,
2124
- schema
2125
+ schema,
2126
+ context
2125
2127
  }) {
2126
2128
  const actualSchema = asSchema(schema);
2127
2129
  try {
@@ -2134,13 +2136,13 @@ async function safeValidateTypes({
2134
2136
  }
2135
2137
  return {
2136
2138
  success: false,
2137
- error: import_provider8.TypeValidationError.wrap({ value, cause: result.error }),
2139
+ error: import_provider8.TypeValidationError.wrap({ value, cause: result.error, context }),
2138
2140
  rawValue: value
2139
2141
  };
2140
2142
  } catch (error) {
2141
2143
  return {
2142
2144
  success: false,
2143
- error: import_provider8.TypeValidationError.wrap({ value, cause: error }),
2145
+ error: import_provider8.TypeValidationError.wrap({ value, cause: error, context }),
2144
2146
  rawValue: value
2145
2147
  };
2146
2148
  }