New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@new10com/axios-logger

Package Overview
Dependencies
Maintainers
33
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@new10com/axios-logger - npm Package Compare versions

Comparing version 0.2.9 to 0.2.10

7

dist/src/formatter/formatter.js

@@ -5,2 +5,3 @@ "use strict";

const constants_1 = require("../constants/constants");
const buffer_1 = require("buffer");
class Formatter {

@@ -42,5 +43,5 @@ constructor(config) {

if (maxLogContentLength !== undefined) {
const bodyLengthInKv = new TextEncoder().encode(bodyAsString).length;
if (bodyLengthInKv > maxLogContentLength) {
return `Body is too long to be displayed. Length: ${bodyLengthInKv}kb. Max length: ${maxLogContentLength}kb.`;
const bodyLengthInBytes = buffer_1.Buffer.byteLength(bodyAsString);
if (bodyLengthInBytes > maxLogContentLength) {
return `Body is too long to be displayed. Length: ${bodyLengthInBytes} bytes. Max length: ${maxLogContentLength} bytes.`;
}

@@ -47,0 +48,0 @@ }

@@ -35,3 +35,3 @@ "use strict";

const body = 'Hello how are you?'.repeat(100);
expect(formatter.prettyFormatBody({ body, maxLogContentLength: 10 })).toEqual(`Body is too long to be displayed. Length: 1802kb. Max length: 10kb.`);
expect(formatter.prettyFormatBody({ body, maxLogContentLength: 10 })).toEqual(`Body is too long to be displayed. Length: 1802 bytes. Max length: 10 bytes.`);
});

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

{
"name": "@new10com/axios-logger",
"version": "0.2.9",
"version": "0.2.10",
"description": "Library that should be used as axios request/response interceptor for logging in a pretty format request/response details",

@@ -5,0 +5,0 @@ "keywords": [

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