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

@restroom-mw/logger

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@restroom-mw/logger - npm Package Compare versions

Comparing version 0.13.1-514f76b.75 to 0.13.1-69dae1d.83

10

dist/index.js

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

const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const utils_1 = require("@restroom-mw/utils");

@@ -34,4 +35,5 @@ require("dotenv").config();

const addLog = (sentences, where) => {
validatePath(where);
const ws = fs_1.default.createWriteStream(where, { flags: "a" });
const absolutePath = path_1.default.resolve(path_1.default.join(exports.LOGGER_DIR, where));
validatePath(absolutePath);
const ws = fs_1.default.createWriteStream(absolutePath, { flags: "a" });
ws.on('error', (error) => {

@@ -45,3 +47,3 @@ throw new Error(`[LOGGER] An error occurred while writing to ${where}\n${error}`);

for (const [sentence, where] of params) {
addLog([input[sentence] || sentence], where);
addLog([result[sentence] || input[sentence] || sentence], where);
}

@@ -56,3 +58,3 @@ }

}
addLog([input[sentence] || sentence], logPath);
addLog([result[sentence] || input[sentence] || sentence], logPath);
}

@@ -59,0 +61,0 @@ }

4

package.json
{
"name": "@restroom-mw/logger",
"version": "0.13.1-514f76b.75+514f76b",
"version": "0.13.1-69dae1d.83+69dae1d",
"description": "Utilities middleware to work with files for Restroom",

@@ -36,3 +36,3 @@ "author": "Alberto Lerda <alberto@dyne.org>",

},
"gitHead": "514f76baa214524ecfa09722b8a823026813ba17"
"gitHead": "69dae1df2b90346c016aadea221fdd63d86ba2fb"
}

@@ -28,4 +28,5 @@ import {Restroom} from "@restroom-mw/core";

const addLog = (sentences: string[], where: string) => {
validatePath(where);
const ws = fs.createWriteStream(where, {flags: "a"});
const absolutePath = path.resolve(path.join(LOGGER_DIR, where));
validatePath(absolutePath);
const ws = fs.createWriteStream(absolutePath, {flags: "a"});
ws.on('error', (error) => {

@@ -41,3 +42,3 @@ throw new Error(

for(const [ sentence, where ] of params) {
addLog([ input[sentence] || sentence ], where);
addLog([ result[sentence] || input[sentence] || sentence ], where);
}

@@ -53,3 +54,3 @@ }

}
addLog([ input[sentence] || sentence ], logPath);
addLog([ result[sentence] || input[sentence] || sentence ], logPath);
}

@@ -56,0 +57,0 @@ }

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