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

@osskit/fetch-enhancers

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@osskit/fetch-enhancers - npm Package Compare versions

Comparing version 1.1.3 to 2.0.0

2

dist/src/enhancers/withHeaders.d.ts
import type { Fetch } from '../types';
export declare const withHeaders: (fetch: Fetch, headers: Record<string, string>) => Fetch;
export declare const withHeaders: (fetch: Fetch, getHeaders: () => Record<string, string>) => Fetch;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withHeaders = void 0;
const withHeaders = (fetch, headers) => (url, init) => fetch(url, {
const withHeaders = (fetch, getHeaders) => (url, init) => fetch(url, {
...init,
headers: {
...init?.headers,
...headers,
...getHeaders(),
},

@@ -10,0 +10,0 @@ });

{
"name": "@osskit/fetch-enhancers",
"version": "1.1.3",
"version": "2.0.0",
"repository": {

@@ -5,0 +5,0 @@ "url": "https://github.com/osskit/fetch-enhancers"

@@ -6,3 +6,3 @@ import type { RequestInfo, RequestInit } from 'node-fetch';

export const withHeaders =
(fetch: Fetch, headers: Record<string, string>): Fetch =>
(fetch: Fetch, getHeaders: () => Record<string, string>): Fetch =>
(url: RequestInfo, init?: RequestInit) =>

@@ -13,4 +13,4 @@ fetch(url, {

...init?.headers,
...headers,
...getHeaders(),
},
});

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