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

@friggframework/errors

Package Overview
Dependencies
Maintainers
3
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@friggframework/errors - npm Package Compare versions

Comparing version 1.1.6-canary.103.e147906.0 to 1.1.6-canary.124.e030db1.0

9

fetch-error.js

@@ -13,3 +13,10 @@ const { BaseError } = require('./base-error');

const method = init?.method ?? 'GET';
const initText = init ? JSON.stringify({ init }, null, 2) : '';
const initText = init
? init.body instanceof URLSearchParams
? (() => {
init.body = init.body.toString();
return JSON.stringify({ init }, null, 2);
})()
: JSON.stringify({ init }, null, 2)
: '';

@@ -16,0 +23,0 @@ let responseBodyText = '<response body is unavailable>';

const fetch = require('node-fetch');
const { stripIndent } = require('common-tags');
const { FetchError } = require('./fetch-error');
const FormData = require('form-data');

@@ -54,2 +55,26 @@ describe('FetchError', () => {

});
it.only('prints a formData body legibly', async () => {
const response = {
status: 500,
statusText: 'Space aliens!',
headers: Object.entries({ 'cache-control': '123' }), // needs to be an Iterable
text: async () => '<!doctype html>',
};
const params = new URLSearchParams();
params.append('test', 'test');
const init = {
method: 'POST',
credentials: 'include',
headers: {},
query: {},
body: params,
returnFullRes: false,
};
const error = await FetchError.create({ response, init });
expect(error).toHaveProperty('message');
expect(error.message).toContain('test=test');
});
});

6

package.json
{
"name": "@friggframework/errors",
"version": "1.1.6-canary.103.e147906.0",
"version": "1.1.6-canary.124.e030db1.0",
"prettier": "@friggframework/prettier-config",

@@ -8,3 +8,3 @@ "description": "",

"devDependencies": {
"@friggframework/eslint-config": "1.0.9-canary.103.e147906.0",
"@friggframework/eslint-config": "^1.0.8",
"eslint": "^8.22.0",

@@ -23,3 +23,3 @@ "jest": "^28.1.3",

},
"gitHead": "e14790648eccf3699d4b163f21a56d00d00ecc57"
"gitHead": "e030db1c862f6c0d01f8ab7517804af02df46ac0"
}
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