update object assignment

This commit is contained in:
2016-02-20 10:50:32 +01:00
parent 190aab3a11
commit f9b89cc9db
10 changed files with 12 additions and 33 deletions

View File

@ -4,7 +4,8 @@ import environment = require("./smartenv.environment");
import objectstorage = require("./smartenv.objectstorage");
var smartenv:any = {}; //create smartenv object
environment.init(smartenv);
smartenv.getEnv = environment.getEnv;
smartenv.printEnv = environment.printEnv;
smartenv.obs = objectstorage.obs;
export = smartenv;

View File

@ -14,7 +14,7 @@ var envDetermined:boolean = false;
* returns the environment
* @returns {Environment}
*/
var getEnv = function(){
export var getEnv = function(){
if (!envDetermined) {
environment = new classes.Environment();
envDetermined = true; // ensure code above only runs once
@ -25,7 +25,7 @@ var getEnv = function(){
/**
* prints the environment to console
*/
var printEnv = function() {
export var printEnv = function() {
if (this.getEnv().isNode) {
plugins.beautylog.ok("running on NODE");
var smartenvVersion = require("../package.json").version;
@ -36,9 +36,4 @@ var printEnv = function() {
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(objectStorage.obs.getAll()));
};
export var init = function(objectArg) {
objectArg.getEnv = getEnv;
objectArg.printEnv = printEnv;
};