smartenv/ts/smartenv.classes.ts
2015-11-30 19:58:35 +01:00

21 lines
633 B
TypeScript

/// <reference path="index.ts" />
class Environment {
public runtimeEnv:string;
public userAgent:string;
public nodeVersion;
public isBrowser:boolean;
public isNode:boolean;
constructor(runtimeEnvArg,userAgentArg = "undefined") {
this.runtimeEnv = runtimeEnvArg;
this.userAgent = userAgentArg;
if(runtimeEnvArg == "node"){
this.isBrowser = false;
this.isNode = true;
this.nodeVersion = process.version;
} else {
this.isBrowser = true;
this.isNode = true;
this.nodeVersion = "undefined";
}
};
}