@segment/analytics-next
Version:
Analytics Next (aka Analytics 2.0) is the latest version of Segment’s JavaScript SDK - enabling you to send your data to any tool without having to learn, test, or use a new API every time.
12 lines (10 loc) • 319 B
text/typescript
/**
* Returns `process.env` if it is available in the environment.
* Always returns an object make it similarly easy to use as `process.env`.
*/
export function getProcessEnv(): { [key: string]: string | undefined } {
if (typeof process === 'undefined' || !process.env) {
return {}
}
return process.env
}