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

ky

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ky - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1

7

index.js

@@ -49,3 +49,2 @@ /*! MIT License © Sindre Sorhus */

const supportsStreams = typeof globals.ReadableStream === 'function';
const supportsFormData = typeof globals.FormData === 'function';

@@ -244,9 +243,5 @@ const deepMerge = (...sources) => {

url.search = new URLSearchParams(this._options.searchParams);
this.request = new globals.Request(url, this.request);
this.request = new globals.Request(new globals.Request(url, this.request), this._options);
}
if (((supportsFormData && this._options.body instanceof globals.FormData) || this._options.body instanceof URLSearchParams) && this.request.headers.has('content-type')) {
throw new Error(`The \`content-type\` header cannot be used with a ${this._options.body.constructor.name} body. It will be set automatically.`);
}
if (this._options.json) {

@@ -253,0 +248,0 @@ this._options.body = JSON.stringify(this._options.json);

3

package.json
{
"name": "ky",
"version": "0.16.0",
"version": "0.16.1",
"description": "Tiny and elegant HTTP client based on the browser Fetch API",
"license": "MIT",
"repository": "sindresorhus/ky",
"funding": "https://github.com/sindresorhus/ky?sponsor=1",
"author": {

@@ -8,0 +9,0 @@ "name": "Sindre Sorhus",

@@ -184,3 +184,2 @@ <div align="center">

Type: `object | number`\
Default:

@@ -421,3 +420,3 @@ - `limit`: `2`

Sending form data in Ky is identical to `fetch`. Just pass a [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) instance to the `body` option. The `Content-Type` header will be automatically set to `multipart/form-data`. Setting it manually will result in an error.
Sending form data in Ky is identical to `fetch`. Just pass a [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) instance to the `body` option. The `Content-Type` header will be automatically set to `multipart/form-data`.

@@ -424,0 +423,0 @@ ```js

@@ -55,3 +55,2 @@ (function (global, factory) {

const supportsStreams = typeof globals.ReadableStream === 'function';
const supportsFormData = typeof globals.FormData === 'function';

@@ -250,9 +249,5 @@ const deepMerge = (...sources) => {

url.search = new URLSearchParams(this._options.searchParams);
this.request = new globals.Request(url, this.request);
this.request = new globals.Request(new globals.Request(url, this.request), this._options);
}
if (((supportsFormData && this._options.body instanceof globals.FormData) || this._options.body instanceof URLSearchParams) && this.request.headers.has('content-type')) {
throw new Error(`The \`content-type\` header cannot be used with a ${this._options.body.constructor.name} body. It will be set automatically.`);
}
if (this._options.json) {

@@ -259,0 +254,0 @@ this._options.body = JSON.stringify(this._options.json);

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