Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ai-sdk/provider-utils

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/provider-utils - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

21

./dist/index.js

@@ -41,2 +41,3 @@ "use strict";

getErrorMessage: () => getErrorMessage,
isAbortError: () => isAbortError,
isParseableJson: () => isParseableJson,

@@ -84,2 +85,7 @@ loadApiKey: () => loadApiKey,

// src/is-abort-error.ts
function isAbortError(error) {
return error instanceof DOMException && (error.name === "AbortError" || error.name === "TimeoutError");
}
// src/load-api-key.ts

@@ -259,6 +265,4 @@ var import_provider = require("@ai-sdk/provider");

} catch (error) {
if (error instanceof Error) {
if (error.name === "AbortError" || import_provider4.APICallError.isAPICallError(error)) {
throw error;
}
if (isAbortError(error) || import_provider4.APICallError.isAPICallError(error)) {
throw error;
}

@@ -282,3 +286,3 @@ throw new import_provider4.APICallError({

if (error instanceof Error) {
if (error.name === "AbortError" || import_provider4.APICallError.isAPICallError(error)) {
if (isAbortError(error) || import_provider4.APICallError.isAPICallError(error)) {
throw error;

@@ -296,6 +300,4 @@ }

} catch (error) {
if (error instanceof Error) {
if (error.name === "AbortError") {
throw error;
}
if (isAbortError(error)) {
throw error;
}

@@ -452,2 +454,3 @@ if (error instanceof TypeError && error.message === "fetch failed") {

getErrorMessage,
isAbortError,
isParseableJson,

@@ -454,0 +457,0 @@ loadApiKey,

@@ -20,2 +20,4 @@ import { JSONParseError, TypeValidationError, APICallError } from '@ai-sdk/provider';

declare function isAbortError(error: unknown): error is DOMException;
declare function loadApiKey({ apiKey, environmentVariableName, apiKeyParameterName, description, }: {

@@ -159,2 +161,2 @@ apiKey: string | undefined;

export { type ParseResult, type ResponseHandler, convertBase64ToUint8Array, convertUint8ArrayToBase64, createEventSourceResponseHandler, createJsonErrorResponseHandler, createJsonResponseHandler, extractResponseHeaders, generateId, getErrorMessage, isParseableJson, loadApiKey, parseJSON, postJsonToApi, postToApi, safeParseJSON, safeValidateTypes, validateTypes, withoutTrailingSlash };
export { type ParseResult, type ResponseHandler, convertBase64ToUint8Array, convertUint8ArrayToBase64, createEventSourceResponseHandler, createJsonErrorResponseHandler, createJsonResponseHandler, extractResponseHeaders, generateId, getErrorMessage, isAbortError, isParseableJson, loadApiKey, parseJSON, postJsonToApi, postToApi, safeParseJSON, safeValidateTypes, validateTypes, withoutTrailingSlash };

@@ -41,2 +41,3 @@ "use strict";

getErrorMessage: () => getErrorMessage,
isAbortError: () => isAbortError,
isParseableJson: () => isParseableJson,

@@ -84,2 +85,7 @@ loadApiKey: () => loadApiKey,

// src/is-abort-error.ts
function isAbortError(error) {
return error instanceof DOMException && (error.name === "AbortError" || error.name === "TimeoutError");
}
// src/load-api-key.ts

@@ -259,6 +265,4 @@ var import_provider = require("@ai-sdk/provider");

} catch (error) {
if (error instanceof Error) {
if (error.name === "AbortError" || import_provider4.APICallError.isAPICallError(error)) {
throw error;
}
if (isAbortError(error) || import_provider4.APICallError.isAPICallError(error)) {
throw error;
}

@@ -282,3 +286,3 @@ throw new import_provider4.APICallError({

if (error instanceof Error) {
if (error.name === "AbortError" || import_provider4.APICallError.isAPICallError(error)) {
if (isAbortError(error) || import_provider4.APICallError.isAPICallError(error)) {
throw error;

@@ -296,6 +300,4 @@ }

} catch (error) {
if (error instanceof Error) {
if (error.name === "AbortError") {
throw error;
}
if (isAbortError(error)) {
throw error;
}

@@ -452,2 +454,3 @@ if (error instanceof TypeError && error.message === "fetch failed") {

getErrorMessage,
isAbortError,
isParseableJson,

@@ -454,0 +457,0 @@ loadApiKey,

{
"name": "@ai-sdk/provider-utils",
"version": "0.0.3",
"version": "0.0.4",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc