@megatherium/log
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -20,4 +20,2 @@ "use strict"; | ||
var _fs = _interopRequireDefault(require("fs")); | ||
var _moment = _interopRequireDefault(require("moment")); | ||
@@ -33,6 +31,3 @@ | ||
var readdir = (0, _util.promisify)(_fs["default"].readdir), | ||
stat = (0, _util.promisify)(_fs["default"].stat), | ||
unlink = (0, _util.promisify)(_fs["default"].unlink), | ||
writeFile = (0, _util.promisify)(_fs["default"].writeFile); // if (process.env.NODE_ENV !== 'production') { | ||
// if (process.env.NODE_ENV !== 'production') { | ||
// logger.add(new winston.transports.Console({ | ||
@@ -42,3 +37,2 @@ // format: winston.format.simple() | ||
// } | ||
var Logger = | ||
@@ -102,3 +96,3 @@ /*#__PURE__*/ | ||
value: function clear() { | ||
var filenames, i, filename, stats; | ||
var fs, readdir, stat, unlink, writeFile, filenames, i, filename, stats; | ||
return _regenerator["default"].async(function clear$(_context) { | ||
@@ -116,12 +110,13 @@ while (1) { | ||
case 2: | ||
_context.next = 4; | ||
fs = require('fs'), readdir = (0, _util.promisify)(fs.readdir), stat = (0, _util.promisify)(fs.stat), unlink = (0, _util.promisify)(fs.unlink), writeFile = (0, _util.promisify)(fs.writeFile); | ||
_context.next = 5; | ||
return _regenerator["default"].awrap(readdir(this.meta.logDirectory)); | ||
case 4: | ||
case 5: | ||
filenames = _context.sent; | ||
i = 0; | ||
case 6: | ||
case 7: | ||
if (!(i < filenames.length)) { | ||
_context.next = 18; | ||
_context.next = 19; | ||
break; | ||
@@ -131,25 +126,25 @@ } | ||
filename = _path["default"].join(this.meta.logDirectory, filenames[i]); | ||
_context.next = 10; | ||
_context.next = 11; | ||
return _regenerator["default"].awrap(stat(filename)); | ||
case 10: | ||
case 11: | ||
stats = _context.sent; | ||
if (stats.isFile()) { | ||
_context.next = 13; | ||
_context.next = 14; | ||
break; | ||
} | ||
return _context.abrupt("continue", 15); | ||
return _context.abrupt("continue", 16); | ||
case 13: | ||
_context.next = 15; | ||
case 14: | ||
_context.next = 16; | ||
return _regenerator["default"].awrap(writeFile(filename, '')); | ||
case 15: | ||
case 16: | ||
++i; | ||
_context.next = 6; | ||
_context.next = 7; | ||
break; | ||
case 18: | ||
case 19: | ||
case "end": | ||
@@ -156,0 +151,0 @@ return _context.stop(); |
{ | ||
"name": "@megatherium/log", | ||
"license": "UNLICENSED", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "dist/index.js", | ||
@@ -23,3 +23,3 @@ "author": { | ||
"test": "npm run test:unit && npm run test:integration && npm run test:longterm", | ||
"test:integration": "integration-test", | ||
"test:integration": "npm run build && integration-test", | ||
"test:integration:longterm": "integration-test-longterm", | ||
@@ -26,0 +26,0 @@ "test:longterm": "npm run test:unit:longterm && npm run test:integration:longterm", |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
28074
629