Skip to content

Commit 8472990

Browse files
fix: remove redundant null check, document Commander/argv decoupling
1 parent 34deaa8 commit 8472990

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

apps/jscpd-server/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function initServerCli(packageJson: any, argv: string[]): Command {
2626
)
2727
.option(
2828
"--gcf",
29+
// Parsed directly via process.argv in serialize.ts for decoupling:
30+
// the serialize module works independently of the server startup flow.
2931
"Enable GCF output format for MCP tool responses (56% fewer tokens)",
3032
);
3133

apps/jscpd-server/src/server/serialize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function isGcfEnabled(): boolean {
4040
* Drop-in replacement for JSON.stringify(data, null, 2).
4141
*/
4242
export function serialize(data: unknown, indent = 2): string {
43-
if (isGcfEnabled() && encodeGeneric) {
43+
if (isGcfEnabled()) {
4444
try {
4545
return encodeGeneric(data);
4646
} catch {

0 commit comments

Comments
 (0)