@@ -139,12 +139,7 @@ function _getRamSize() {
139
139
* @private
140
140
*/
141
141
function _getNodeVersion ( ) {
142
- // We use any here because p.release is a new Node construct in Node 10 (and our typings are the
143
- // minimal version of Node we support).
144
- const p = process as any ; // tslint:disable-line:no-any
145
- const name =
146
- ( typeof p . release == 'object' && typeof p . release . name == 'string' && p . release . name ) ||
147
- process . argv0 ;
142
+ const name = process . release . name || process . argv0 ;
148
143
149
144
return name + ' ' + process . version ;
150
145
}
@@ -590,9 +585,7 @@ export async function getWorkspaceAnalytics(): Promise<UniversalAnalytics | unde
590
585
analyticsDebug ( 'getWorkspaceAnalytics' ) ;
591
586
try {
592
587
const globalWorkspace = await getWorkspace ( 'local' ) ;
593
- const analyticsConfig : string | undefined | null | { uid ?: string } = globalWorkspace
594
- && globalWorkspace . getCli ( )
595
- && globalWorkspace . getCli ( ) [ 'analytics' ] ;
588
+ const analyticsConfig : string | undefined | null | { uid ?: string } = globalWorkspace ?. getCli ( ) [ 'analytics' ] ;
596
589
analyticsDebug ( 'Workspace Analytics config found: %j' , analyticsConfig ) ;
597
590
598
591
if ( analyticsConfig === false ) {
@@ -645,8 +638,7 @@ export async function getSharedAnalytics(): Promise<UniversalAnalytics | undefin
645
638
// If anything happens we just keep the NOOP analytics.
646
639
try {
647
640
const globalWorkspace = await getWorkspace ( 'global' ) ;
648
- const analyticsConfig =
649
- globalWorkspace && globalWorkspace . getCli ( ) && globalWorkspace . getCli ( ) [ 'analyticsSharing' ] ;
641
+ const analyticsConfig = globalWorkspace ?. getCli ( ) [ 'analyticsSharing' ] ;
650
642
651
643
if ( ! analyticsConfig || ! analyticsConfig . tracking || ! analyticsConfig . uuid ) {
652
644
return undefined ;
0 commit comments