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

@magicul/react-chat-stream

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magicul/react-chat-stream - npm Package Compare versions

Comparing version 0.2.1 to 0.2.3

16

dist/utils/streams.js
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -52,2 +63,5 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

exports.decodeStreamToJson = exports.getStream = void 0;
var DEFAULT_HEADERS = {
'Content-Type': 'application/json',
};
var mergeInputInOptions = function (input, options, method) {

@@ -69,3 +83,3 @@ var _a;

method: options.method,
headers: options.headers,
headers: __assign(__assign({}, DEFAULT_HEADERS), options.headers),
body: JSON.stringify(options.body, function (_k, v) { return v === null ? undefined : v; })

@@ -72,0 +86,0 @@ })];

2

package.json
{
"name": "@magicul/react-chat-stream",
"description": "A React hook that lets you easily integrate your custom ChatGPT-like chat in React.",
"version": "0.2.1",
"version": "0.2.3",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "dist/index.d.ts",

@@ -6,2 +6,6 @@ import type {

const DEFAULT_HEADERS = {
'Content-Type': 'application/json',
};
const mergeInputInOptions = (input: string, options: UseChatStreamOptions, method: UseChatStreamInputMethod) => {

@@ -22,3 +26,6 @@ options.query = options.query ?? {};

method: options.method,
headers: options.headers,
headers: {
...DEFAULT_HEADERS,
...options.headers
},
body: JSON.stringify(options.body, (_k, v) => v === null ? undefined : v)

@@ -25,0 +32,0 @@ });

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