Socket
Socket
Sign inDemoInstall

@vitrical/utils

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

@vitrical/utils - npm Package Compare versions

Comparing version 1.2.8 to 1.3.0

17

api.js

@@ -31,4 +31,15 @@ "use strict";

}
const message = res.body?.msg
? `Request failed with status code ${res.status} ( ${res.body.msg} )`
const requestMsg = typeof res.body?.msg === 'string'
? res.body.msg
: typeof res.body?.error === 'string'
? res.body.error
: typeof res.body?.message === 'string'
? res.body.message
: typeof res.body === 'string'
? res.body
: typeof res.body?.text === 'string'
? res.body.text
: undefined;
const message = requestMsg
? `Request failed with status code ${res.status} ( ${requestMsg} )`
: `Request failed with status code ${res.status}`;

@@ -41,3 +52,3 @@ const apiError = new ApiError(message);

apiError.url = url;
apiError.msg = res.body?.msg || '';
apiError.msg = requestMsg ?? message;
return apiError;

@@ -44,0 +55,0 @@ }

2

package.json
{
"name": "@vitrical/utils",
"version": "1.2.8",
"version": "1.3.0",
"description": "Collection of useful functions and typings",

@@ -5,0 +5,0 @@ "main": "index.js",

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