@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.mjs CHANGED
@@ -410,7 +410,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
410
410
  }
411
411
 
412
412
  // src/version.ts
413
- var VERSION = true ? "4.0.10" : "0.0.0-test";
413
+ var VERSION = true ? "4.0.11" : "0.0.0-test";
414
414
 
415
415
  // src/get-from-api.ts
416
416
  var getOriginalFetch = () => globalThis.fetch;
@@ -2023,17 +2023,19 @@ function zodSchema(zodSchema2, options) {
2023
2023
  // src/validate-types.ts
2024
2024
  async function validateTypes({
2025
2025
  value,
2026
- schema
2026
+ schema,
2027
+ context
2027
2028
  }) {
2028
- const result = await safeValidateTypes({ value, schema });
2029
+ const result = await safeValidateTypes({ value, schema, context });
2029
2030
  if (!result.success) {
2030
- throw TypeValidationError2.wrap({ value, cause: result.error });
2031
+ throw TypeValidationError2.wrap({ value, cause: result.error, context });
2031
2032
  }
2032
2033
  return result.value;
2033
2034
  }
2034
2035
  async function safeValidateTypes({
2035
2036
  value,
2036
- schema
2037
+ schema,
2038
+ context
2037
2039
  }) {
2038
2040
  const actualSchema = asSchema(schema);
2039
2041
  try {
@@ -2046,13 +2048,13 @@ async function safeValidateTypes({
2046
2048
  }
2047
2049
  return {
2048
2050
  success: false,
2049
- error: TypeValidationError2.wrap({ value, cause: result.error }),
2051
+ error: TypeValidationError2.wrap({ value, cause: result.error, context }),
2050
2052
  rawValue: value
2051
2053
  };
2052
2054
  } catch (error) {
2053
2055
  return {
2054
2056
  success: false,
2055
- error: TypeValidationError2.wrap({ value, cause: error }),
2057
+ error: TypeValidationError2.wrap({ value, cause: error, context }),
2056
2058
  rawValue: value
2057
2059
  };
2058
2060
  }