rangoo94/bestest

View on GitHub
packages/detect-environment/lib/getProcessObject.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { ProcessInterface } from './interfaces/ProcessInterface'

/**
 * Get 'process' or process-like object,
 * to retrieve data about environment.
 *
 * @returns {ProcessInterface|object}
 */
function getProcessObject (): ProcessInterface {
  return typeof process === 'object' && process ? process : {
    arch: null,
    version: null,
    versions: { v8: null }
  }
}

export {
  getProcessObject
}