Skip to content

Commit 15cf775

Browse files
committed
fix: replace lodash with lodash-es for better tree-shaking support
Signed-off-by: kaifcoder <[email protected]>
1 parent 0d84484 commit 15cf775

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

bin/lib/logs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'fs';
22
import path from 'path';
33
import { spawn } from 'node:child_process';
44
import chalk from 'chalk';
5-
import _ from 'lodash';
5+
import { escapeRegExp } from 'lodash-es';
66
import chokidar from 'chokidar';
77

88
// Log levels and their colors
@@ -123,7 +123,7 @@ async function readLogsFromFile(filePath, options = {}) {
123123
}
124124

125125
if (options.filter) {
126-
const safeFilter = _.escapeRegExp(options.filter);
126+
const safeFilter = escapeRegExp(options.filter);
127127
const regex = new RegExp(safeFilter, 'i');
128128
logs = logs.filter(log => regex.test(log.message) || regex.test(log.raw));
129129
}
@@ -801,7 +801,7 @@ export class LogFileWatcher {
801801

802802
// Apply text filter
803803
if (options.filter) {
804-
const safeFilter = _.escapeRegExp(options.filter);
804+
const safeFilter = escapeRegExp(options.filter);
805805
const regex = new RegExp(safeFilter, 'i');
806806
filteredLogs = filteredLogs.filter(log =>
807807
regex.test(log.message) || regex.test(log.raw || '')

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"execa": "^9.6.0",
5757
"fs-extra": "^11.3.2",
5858
"hookable": "^5.5.3",
59-
"lodash": "^4.17.21",
59+
"lodash-es": "^4.17.21",
6060
"pidusage": "^4.0.1",
6161
"prompts": "^2.4.2",
6262
"systeminformation": "^5.27.11",

0 commit comments

Comments
 (0)