@ai-sdk/provider
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -431,3 +431,3 @@ "use strict"; | ||
var _a11; | ||
var TypeValidationError = class extends AISDKError { | ||
var _TypeValidationError = class _TypeValidationError extends AISDKError { | ||
constructor({ value, cause }) { | ||
@@ -447,2 +447,18 @@ super({ | ||
/** | ||
* Wraps an error into a TypeValidationError. | ||
* If the cause is already a TypeValidationError with the same value, it returns the cause. | ||
* Otherwise, it creates a new TypeValidationError. | ||
* | ||
* @param {Object} params - The parameters for wrapping the error. | ||
* @param {unknown} params.value - The value that failed validation. | ||
* @param {unknown} params.cause - The original error or cause of the validation failure. | ||
* @returns {TypeValidationError} A TypeValidationError instance. | ||
*/ | ||
static wrap({ | ||
value, | ||
cause | ||
}) { | ||
return _TypeValidationError.isInstance(cause) && cause.value === value ? cause : new _TypeValidationError({ value, cause }); | ||
} | ||
/** | ||
* @deprecated use `isInstance` instead | ||
@@ -467,2 +483,3 @@ */ | ||
_a11 = symbol11; | ||
var TypeValidationError = _TypeValidationError; | ||
@@ -469,0 +486,0 @@ // src/errors/unsupported-functionality-error.ts |
@@ -361,2 +361,16 @@ import { JSONSchema7 } from 'json-schema'; | ||
/** | ||
* Wraps an error into a TypeValidationError. | ||
* If the cause is already a TypeValidationError with the same value, it returns the cause. | ||
* Otherwise, it creates a new TypeValidationError. | ||
* | ||
* @param {Object} params - The parameters for wrapping the error. | ||
* @param {unknown} params.value - The value that failed validation. | ||
* @param {unknown} params.cause - The original error or cause of the validation failure. | ||
* @returns {TypeValidationError} A TypeValidationError instance. | ||
*/ | ||
static wrap({ value, cause, }: { | ||
value: unknown; | ||
cause: unknown; | ||
}): TypeValidationError; | ||
/** | ||
* @deprecated use `isInstance` instead | ||
@@ -363,0 +377,0 @@ */ |
@@ -431,3 +431,3 @@ "use strict"; | ||
var _a11; | ||
var TypeValidationError = class extends AISDKError { | ||
var _TypeValidationError = class _TypeValidationError extends AISDKError { | ||
constructor({ value, cause }) { | ||
@@ -447,2 +447,18 @@ super({ | ||
/** | ||
* Wraps an error into a TypeValidationError. | ||
* If the cause is already a TypeValidationError with the same value, it returns the cause. | ||
* Otherwise, it creates a new TypeValidationError. | ||
* | ||
* @param {Object} params - The parameters for wrapping the error. | ||
* @param {unknown} params.value - The value that failed validation. | ||
* @param {unknown} params.cause - The original error or cause of the validation failure. | ||
* @returns {TypeValidationError} A TypeValidationError instance. | ||
*/ | ||
static wrap({ | ||
value, | ||
cause | ||
}) { | ||
return _TypeValidationError.isInstance(cause) && cause.value === value ? cause : new _TypeValidationError({ value, cause }); | ||
} | ||
/** | ||
* @deprecated use `isInstance` instead | ||
@@ -467,2 +483,3 @@ */ | ||
_a11 = symbol11; | ||
var TypeValidationError = _TypeValidationError; | ||
@@ -469,0 +486,0 @@ // src/errors/unsupported-functionality-error.ts |
{ | ||
"name": "@ai-sdk/provider", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158745
2389