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

@ai-sdk/react

Package Overview
Dependencies
Maintainers
2
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/react - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

9

CHANGELOG.md
# @ai-sdk/react
## 1.0.4
### Patch Changes
- 953469c: chore (ui): extract prepareAttachmentsForRequest
- Updated dependencies [953469c]
- Updated dependencies [a3dd2ed]
- @ai-sdk/ui-utils@1.0.3
## 1.0.3

@@ -4,0 +13,0 @@

37

dist/index.js

@@ -420,6 +420,3 @@ "use strict";

var _a, _b;
if (!message.id) {
message.id = generateId2();
}
const attachmentsForRequest = await prepareAttachmentsForRequest(
const attachmentsForRequest = await (0, import_ui_utils2.prepareAttachmentsForRequest)(
experimental_attachments

@@ -492,3 +489,3 @@ );

}
const attachmentsForRequest = await prepareAttachmentsForRequest(
const attachmentsForRequest = await (0, import_ui_utils2.prepareAttachmentsForRequest)(
options.experimental_attachments

@@ -573,32 +570,2 @@ );

}
async function prepareAttachmentsForRequest(attachmentsFromOptions) {
if (attachmentsFromOptions == null) {
return [];
}
if (attachmentsFromOptions instanceof FileList) {
return Promise.all(
Array.from(attachmentsFromOptions).map(async (attachment) => {
const { name, type } = attachment;
const dataUrl = await new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = (readerEvent) => {
var _a;
resolve((_a = readerEvent.target) == null ? void 0 : _a.result);
};
reader.onerror = (error) => reject(error);
reader.readAsDataURL(attachment);
});
return {
name,
contentType: type,
url: dataUrl
};
})
);
}
if (Array.isArray(attachmentsFromOptions)) {
return attachmentsFromOptions;
}
throw new Error("Invalid attachments type");
}

@@ -605,0 +572,0 @@ // src/use-completion.ts

{
"name": "@ai-sdk/react",
"version": "1.0.3",
"version": "1.0.4",
"license": "Apache-2.0",

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

"@ai-sdk/provider-utils": "2.0.2",
"@ai-sdk/ui-utils": "1.0.2",
"@ai-sdk/ui-utils": "1.0.3",
"swr": "^2.2.5",

@@ -29,3 +29,3 @@ "throttleit": "2.1.0"

"devDependencies": {
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/user-event": "^14.5.2",

@@ -32,0 +32,0 @@ "@testing-library/react": "^16.0.1",

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