@@ -139,12 +139,7 @@ function _getRamSize() {
139139 * @private
140140 */
141141function _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 ;
148143
149144 return name + ' ' + process . version ;
150145}
@@ -590,9 +585,7 @@ export async function getWorkspaceAnalytics(): Promise<UniversalAnalytics | unde
590585 analyticsDebug ( 'getWorkspaceAnalytics' ) ;
591586 try {
592587 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' ] ;
596589 analyticsDebug ( 'Workspace Analytics config found: %j' , analyticsConfig ) ;
597590
598591 if ( analyticsConfig === false ) {
@@ -645,8 +638,7 @@ export async function getSharedAnalytics(): Promise<UniversalAnalytics | undefin
645638 // If anything happens we just keep the NOOP analytics.
646639 try {
647640 const globalWorkspace = await getWorkspace ( 'global' ) ;
648- const analyticsConfig =
649- globalWorkspace && globalWorkspace . getCli ( ) && globalWorkspace . getCli ( ) [ 'analyticsSharing' ] ;
641+ const analyticsConfig = globalWorkspace ?. getCli ( ) [ 'analyticsSharing' ] ;
650642
651643 if ( ! analyticsConfig || ! analyticsConfig . tracking || ! analyticsConfig . uuid ) {
652644 return undefined ;
0 commit comments