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

@ardatan/graphql-helix

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ardatan/graphql-helix - npm Package Compare versions

Comparing version 0.0.11 to 0.1.12

dist-esm/util/encode-string.d.ts

25

dist/util/get-response.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorResponse = exports.getPushResponse = exports.getMultipartResponse = exports.getRegularResponse = exports.DEFAULT_TRANSFORM_RESULT_FN = void 0;
const calculate_byte_length_1 = require("./calculate-byte-length");
const cross_undici_fetch_1 = require("cross-undici-fetch");
const encode_string_1 = require("./encode-string");
const DEFAULT_TRANSFORM_RESULT_FN = (result) => result;

@@ -11,6 +11,6 @@ exports.DEFAULT_TRANSFORM_RESULT_FN = DEFAULT_TRANSFORM_RESULT_FN;

const responseBody = JSON.stringify(transformedResult);
const contentLength = (0, calculate_byte_length_1.calculateByteLength)(responseBody);
const decodedString = (0, encode_string_1.encodeString)(responseBody);
const headersInit = {
"Content-Type": "application/json",
"Content-Length": contentLength.toString(),
"Content-Length": decodedString.byteLength.toString(),
};

@@ -21,3 +21,3 @@ const responseInit = {

};
return new cross_undici_fetch_1.Response(responseBody, responseInit);
return new cross_undici_fetch_1.Response(decodedString, responseInit);
}

@@ -52,14 +52,11 @@ exports.getRegularResponse = getRegularResponse;

const chunk = JSON.stringify(transformedResult);
const contentLength = (0, calculate_byte_length_1.calculateByteLength)(chunk);
const data = [
"",
"Content-Type: application/json; charset=utf-8",
"Content-Length: " + contentLength.toString(),
"",
chunk,
];
const encodedChunk = (0, encode_string_1.encodeString)(chunk);
controller.enqueue('\r\n');
controller.enqueue('Content-Type: application/json; charset=utf-8\r\n');
controller.enqueue('Content-Length: ' + encodedChunk.byteLength + '\r\n');
controller.enqueue('\r\n');
controller.enqueue(encodedChunk);
if (value.hasNext) {
data.push("---");
controller.enqueue("\r\n---");
}
controller.enqueue(data.join("\r\n"));
}

@@ -66,0 +63,0 @@ },

{
"name": "@ardatan/graphql-helix",
"version": "0.0.11",
"version": "0.1.12",
"description": "A highly evolved GraphQL HTTP Server 🧬",

@@ -5,0 +5,0 @@ "keywords": [

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