Skip to content

Commit

Permalink
fix(@angular/cli): only set DebugView when NG_DEBUG is passed
Browse files Browse the repository at this point in the history
`querystring.stringify` will not remove undefined values.

(cherry picked from commit 7bcb19c)
  • Loading branch information
alan-agius4 committed Feb 2, 2023
1 parent 11be502 commit fabbb8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/angular/cli/src/analytics/analytics-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ export class AnalyticsCollector {
[RequestParameter.UserAgentArchitecture]: os.arch(),
[RequestParameter.UserAgentPlatform]: os.platform(),
[RequestParameter.UserAgentPlatformVersion]: os.version(),

// Set undefined to disable debug view.
[RequestParameter.DebugView]: ngDebug ? 1 : undefined,
};

if (ngDebug) {
requestParameters[RequestParameter.DebugView] = 1;
}

this.requestParameterStringified = querystring.stringify(requestParameters);

const parsedVersion = semver.parse(process.version);
Expand Down

0 comments on commit fabbb8a

Please sign in to comment.