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

@swan-io/request

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swan-io/request - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

dist/Request.d.ts

@@ -34,3 +34,3 @@ import { Future, Option, Result } from "@swan-io/boxed";

};
type Response<T> = {
export type Response<T> = {
status: number;

@@ -37,0 +37,0 @@ ok: boolean;

@@ -0,4 +1,9 @@

# 1.0.1
## Changes
- Expose `Response` type
# 1.0.0
Initial version
{
"name": "@swan-io/request",
"version": "1.0.0",
"version": "1.0.1",
"description": "Wrapper for XMLHttpRequest with better data-structures",

@@ -5,0 +5,0 @@ "main": "dist/Request.js",

@@ -91,7 +91,18 @@ <img width="108" alt="@swan-io/request logo" src="https://github.com/swan-io/request/blob/main/logo.svg?raw=true">

#### emptyToError
#### Return value
Returns a `Future<Result<Response<T>, NetworkError | TimeoutError>>`, where `Response<T>` has the following properties:
- `status`: `number`
- `ok`: `boolean`
- `response`: `Option<T>`
- `xhr`: `XMLHttpRequest`
`T` is the type associated with the `responseType` provided in the `config` object.
### emptyToError
Helper to use with `mapOkToResult` to consider empty response as an error.
#### badStatusToError
### badStatusToError

@@ -98,0 +109,0 @@ Helper to use with `mapOkToResult` to consider a status outside of the 200-299 range as an error.

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