mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-28 13:13:37 +08:00
This CL updates minimist to 1.2.6 to fix a critical security vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2021-44906 The fix was made by running: `npm run install-deps audit fix --audit-level=critical` Bug: none Change-Id: I51103b525d9969e03000d55af86cebdabc7e0366 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3591079 Reviewed-by: Mathias Bynens <mathias@chromium.org> Commit-Queue: Brandon Walderman <brwalder@microsoft.com>
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
const RollingFileWriteStream = require('./RollingFileWriteStream');
|
|
|
|
// just to adapt the previous version
|
|
class DateRollingFileStream extends RollingFileWriteStream {
|
|
constructor(filename, pattern, options) {
|
|
if (pattern && typeof(pattern) === 'object') {
|
|
options = pattern;
|
|
pattern = null;
|
|
}
|
|
if (!options) {
|
|
options = {};
|
|
}
|
|
if (!pattern) {
|
|
pattern = 'yyyy-MM-dd';
|
|
}
|
|
options.pattern = pattern;
|
|
if (!options.numBackups && options.numBackups !== 0) {
|
|
if (!options.daysToKeep && options.daysToKeep !== 0) {
|
|
options.daysToKeep = 1;
|
|
} else {
|
|
process.emitWarning(
|
|
"options.daysToKeep is deprecated due to the confusion it causes when used " +
|
|
"together with file size rolling. Please use options.numBackups instead.",
|
|
"DeprecationWarning", "streamroller-DEP0001"
|
|
);
|
|
}
|
|
options.numBackups = options.daysToKeep;
|
|
} else {
|
|
options.daysToKeep = options.numBackups;
|
|
}
|
|
super(filename, options);
|
|
this.mode = this.options.mode;
|
|
}
|
|
|
|
get theStream() {
|
|
return this.currentFileStream;
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = DateRollingFileStream;
|