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

@schibsted/niche-utils

Package Overview
Dependencies
Maintainers
9
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@schibsted/niche-utils - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

2

lib/fetch/fetchWrapper.d.ts

@@ -1,1 +0,1 @@

export declare const fetchWrapper: <T>(url: string, options?: RequestInit, timeout?: number) => Promise<T>;
export declare const fetchWrapper: <T>(url: string, options?: RequestInit, timeout?: number, timeoutCallback?: () => void) => Promise<T>;

@@ -11,10 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { FetchError } from './fetchError';
export const fetchWrapper = (url, options, timeout) => __awaiter(void 0, void 0, void 0, function* () {
export const fetchWrapper = (url, options, timeout, timeoutCallback) => __awaiter(void 0, void 0, void 0, function* () {
let signal;
if (timeout) {
const controller = new AbortController();
signal = controller.signal;
setTimeout(() => {
controller.abort();
}, timeout);
signal = AbortSignal.timeout(timeout);
if (timeoutCallback) {
signal.onabort = timeoutCallback;
}
}

@@ -21,0 +20,0 @@ const response = yield fetch(url, Object.assign(Object.assign({}, options), { signal }));

{
"name": "@schibsted/niche-utils",
"version": "0.6.0",
"version": "0.6.1",
"repository": {

@@ -28,3 +28,3 @@ "type": "git",

},
"gitHead": "53e12e9bf4ccd6839a4a198b0a4d66baf2ea8145"
"gitHead": "90c2c4d7b72a8d3c5afd1444b318e08795cb6ae1"
}
import { FetchError } from './fetchError';
export const fetchWrapper = async <T>(url: string, options?: RequestInit, timeout?: number): Promise<T> => {
export const fetchWrapper = async <T>(
url: string,
options?: RequestInit,
timeout?: number,
timeoutCallback?: () => void
): Promise<T> => {
let signal: AbortSignal | undefined;
if (timeout) {
const controller = new AbortController();
signal = controller.signal;
setTimeout(() => {
controller.abort();
}, timeout);
signal = AbortSignal.timeout(timeout);
if (timeoutCallback) {
signal.onabort = timeoutCallback;
}
}

@@ -13,0 +18,0 @@

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