Socket
Socket
Sign inDemoInstall

winston-daily-rotate-file

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-daily-rotate-file - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

15

index.js

@@ -72,3 +72,3 @@ 'use strict';

this.timestamp = options.timestamp ? options.timestamp : true;
this.datePattern = options.datePattern ? options.datePattern : 'yyyy-MM-dd';
this.datePattern = options.datePattern ? options.datePattern : '.yyyy-MM-dd';
this.depth = options.depth || null;

@@ -602,13 +602,14 @@ this.eol = options.eol || os.EOL;

DailyRotateFile.prototype._getFilename = function () {
if (this.datePattern.substring(0, 1) === '.') {
this.datePattern = this.datePattern.substring(1);
}
var formattedDate = this.getFormattedDate();
if (this.prepend) {
return [formattedDate, this._basename].join('.');
if (this.datePattern === '.yyyy-MM-dd') {
this.datePattern = 'yyyy-MM-dd.';
formattedDate = this.getFormattedDate();
}
return formattedDate + this._basename;
}
return [this._basename, formattedDate].join('.');
return this._basename + formattedDate;
};

@@ -615,0 +616,0 @@

{
"name": "winston-daily-rotate-file",
"version": "1.1.3",
"version": "1.1.4",
"description": "A transport for winston which logs to a rotating file each day.",

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

@@ -64,2 +64,12 @@ /* eslint-disable max-nested-callbacks,no-unused-expressions */

it('should not add leading dot if one is not provided with datePattern', function () {
var now = moment().format('YYYY-MM-DD');
var transport = new DailyRotateFile({
filename: path.join(fixturesDir, 'log'),
datePattern: '-yyyy-MM-dd.log'
});
expect(transport._getFilename()).to.equal('log-' + now + '.log');
});
it('should remove leading dot if one is provided with datePattern when prepend option is true', function () {

@@ -66,0 +76,0 @@ var now = moment().format('YYYY-MM-DD');

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