winston-daily-rotate-file
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -601,2 +601,6 @@ 'use strict'; | ||
DailyRotateFile.prototype._getFilename = function () { | ||
if (this.datePattern.substring(0, 1) === '.') { | ||
this.datePattern = this.datePattern.substring(1); | ||
} | ||
var formattedDate = this.getFormattedDate(); | ||
@@ -603,0 +607,0 @@ |
{ | ||
"name": "winston-daily-rotate-file", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "A transport for winston which logs to a rotating file each day.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,2 +52,24 @@ /* eslint-disable max-nested-callbacks,no-unused-expressions */ | ||
}); | ||
it('should remove leading dot if one is provided with datePattern', function () { | ||
var now = moment().format('YYYYMMDD'); | ||
var transport = new DailyRotateFile({ | ||
filename: path.join(fixturesDir, 'prepend-false.log'), | ||
prepend: false, | ||
datePattern: '.yyyyMMdd' | ||
}); | ||
expect(transport._getFilename()).to.equal('prepend-false.log.' + now); | ||
}); | ||
it('should remove leading dot if one is provided with datePattern when prepend option is true', function () { | ||
var now = moment().format('YYYY-MM-DD'); | ||
var transport = new DailyRotateFile({ | ||
filename: path.join(fixturesDir, 'prepend-true.log'), | ||
prepend: true, | ||
datePattern: '.yyyy-MM-dd' | ||
}); | ||
expect(transport._getFilename()).to.equal(now + '.prepend-true.log'); | ||
}); | ||
}); | ||
@@ -54,0 +76,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27830
727