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 1.0.0 to 1.0.1

2

./dist/index.js

@@ -161,3 +161,3 @@ "use strict";

function isAbortError(error) {
return error instanceof DOMException && (error.name === "AbortError" || error.name === "TimeoutError");
return error instanceof Error && (error.name === "AbortError" || error.name === "TimeoutError");
}

@@ -164,0 +164,0 @@

@@ -39,3 +39,3 @@ import { JSONParseError, TypeValidationError, APICallError } from '@ai-sdk/provider';

declare function isAbortError(error: unknown): error is DOMException;
declare function isAbortError(error: unknown): error is Error;

@@ -42,0 +42,0 @@ declare function loadApiKey({ apiKey, environmentVariableName, apiKeyParameterName, description, }: {

@@ -161,3 +161,3 @@ "use strict";

function isAbortError(error) {
return error instanceof DOMException && (error.name === "AbortError" || error.name === "TimeoutError");
return error instanceof Error && (error.name === "AbortError" || error.name === "TimeoutError");
}

@@ -164,0 +164,0 @@

{
"name": "@ai-sdk/provider-utils",
"version": "1.0.0",
"version": "1.0.1",
"license": "Apache-2.0",

@@ -35,3 +35,3 @@ "sideEffects": false,

"@types/node": "^18",
"msw": "2.0.9",
"msw": "2.3.1",
"tsup": "^8",

@@ -38,0 +38,0 @@ "typescript": "5.1.3",

import { SetupServer } from 'msw/node';
import { JsonBodyType } from 'msw';
declare function convertArrayToAsyncIterable<T>(values: T[]): AsyncIterable<T>;
declare function convertArrayToReadableStream<T>(values: T[]): ReadableStream<T>;
declare function convertArrayToAsyncIterable<T>(values: T[]): AsyncIterable<T>;
declare function convertAsyncIterableToArray<T>(iterable: AsyncIterable<T>): Promise<T[]>;

@@ -19,2 +20,3 @@

getRequestHeaders(): Promise<Record<string, string>>;
getRequestUrlSearchParams(): Promise<URLSearchParams>;
setupTestEnvironment(): void;

@@ -31,5 +33,44 @@ }

getRequestHeaders(): Promise<Record<string, string>>;
getRequestUrlSearchParams(): Promise<URLSearchParams>;
setupTestEnvironment(): void;
}
type TestServerJsonBodyType = JsonBodyType;
type TestServerResponse = {
url: string;
headers?: Record<string, string>;
} & ({
type: 'json-value';
content: TestServerJsonBodyType;
} | {
type: 'stream-values';
content: Array<string>;
} | {
type: 'controlled-stream';
id?: string;
} | {
type: 'error';
status: number;
content?: string;
});
declare class TestServerCall {
private request;
constructor(request: Request);
getRequestBodyJson(): Promise<any>;
getRequestHeaders(): Record<string, string>;
getRequestUrlSearchParams(): URLSearchParams;
}
declare function withTestServer(responses: Array<TestServerResponse> | TestServerResponse, testFunction: (options: {
calls: () => Array<TestServerCall>;
call: (index: number) => TestServerCall;
getStreamController: (id: string) => ReadableStreamDefaultController<string>;
streamController: ReadableStreamDefaultController<string>;
}) => Promise<void>): () => Promise<void>;
declare function describeWithTestServer(description: string, responses: Array<TestServerResponse> | TestServerResponse, testFunction: (options: {
calls: () => Array<TestServerCall>;
call: (index: number) => TestServerCall;
getStreamController: (id: string) => ReadableStreamDefaultController<string>;
streamController: ReadableStreamDefaultController<string>;
}) => void): void;
/**

@@ -40,2 +81,2 @@ * @deprecated Use `convertReadableStreamToArray` instead.

export { JsonTestServer, StreamingTestServer, convertArrayToAsyncIterable, convertArrayToReadableStream, convertAsyncIterableToArray, convertReadableStreamToArray, convertStreamToArray };
export { JsonTestServer, StreamingTestServer, type TestServerJsonBodyType, type TestServerResponse, convertArrayToAsyncIterable, convertArrayToReadableStream, convertAsyncIterableToArray, convertReadableStreamToArray, convertStreamToArray, describeWithTestServer, withTestServer };

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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