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

rotating-file-stream

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rotating-file-stream - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

.codeclimate.yml

2

compress.js

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

tmp.file({ mode: parseInt("777", 8) }, function(err, path, fd, done) {
tmp.file({ keep: true, mode: parseInt("777", 8) }, function(err, path, fd, done) {
if(err)

@@ -138,0 +138,0 @@ return callback(err);

{
"name": "rotating-file-stream",
"version": "1.1.6",
"version": "1.1.7",
"description": "Opens a stream.Writable to a file rotated by interval and/or size. A logrotate alternative.",

@@ -32,3 +32,3 @@ "scripts": {

"devDependencies": {
"eslint": "3.14.1",
"eslint": "3.15.0",
"istanbul": "0.4.5",

@@ -35,0 +35,0 @@ "mocha-istanbul": "0.3.0",

@@ -307,2 +307,4 @@ # rotating-file-stream

* 2017-02-07 - v1.1.7
* fixed tmp.file call
* 2017-02-03 - v1.1.6

@@ -309,0 +311,0 @@ * eslint

@@ -6,2 +6,11 @@ "use strict";

function buildStringCheck(field, check) {
return function(typ, options, val) {
if(typ !== "string")
throw new Error("Don't know how to handle 'options." + field + "' type: " + typ);
options[field] = check(val);
};
}
function checkMeasure(v, what, units) {

@@ -36,2 +45,7 @@ var ret = {};

function checkIntervalUnit(ret, unit, amount) {
if(parseInt(amount / ret.num, 10) * ret.num !== amount)
throw new Error("An integer divider of " + amount + " is expected as " + unit + " for 'options.interval'");
}
function checkInterval(v) {

@@ -41,15 +55,12 @@ var ret = checkMeasure(v, "interval", intervalUnits);

switch(ret.unit) {
case "m":
if(parseInt(60 / ret.num, 10) * ret.num !== 60)
throw new Error("An integer divider of 60 is expected as minutes for 'options.interval'");
case "h":
checkIntervalUnit(ret, "hours", 24);
break;
case "h":
if(parseInt(24 / ret.num, 10) * ret.num !== 24)
throw new Error("An integer divider of 24 is expected as hours for 'options.interval'");
case "m":
checkIntervalUnit(ret, "minutes", 60);
break;
case "s":
if(parseInt(60 / ret.num, 10) * ret.num !== 60)
throw new Error("An integer divider of 60 is expected as seconds for 'options.interval'");
checkIntervalUnit(ret, "seconds", 60);
break;

@@ -103,9 +114,4 @@ }

"interval": function(typ, options, val) {
if(typ !== "string")
throw new Error("Don't know how to handle 'options.interval' type: " + typ);
"interval": buildStringCheck("interval", checkInterval),
options.interval = checkInterval(val);
},
"mode": function() {},

@@ -127,8 +133,3 @@

"size": function(typ, options, val) {
if(typ !== "string")
throw new Error("Don't know how to handle 'options.size' type: " + typ);
options.size = checkSize(val);
}
"size": buildStringCheck("size", checkSize)
};

@@ -135,0 +136,0 @@

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