diff --git a/index.js b/index.js
index 801d432..4afef85 100644
--- a/index.js
+++ b/index.js
@@ -18,54 +18,83 @@ var Environment = (function () {
;
return Environment;
})();
+///
+/**
+ * Deals with the environment the current JS script is running in.
+ */
+var SmartenvEnvironment;
+(function (SmartenvEnvironment) {
+ function init() {
+ var environment;
+ (function () {
+ var localRunTimeEnv = "undefined";
+ var localUserAgent = "undefined";
+ if (typeof window !== 'undefined') {
+ localRunTimeEnv = 'browser';
+ localUserAgent = navigator.userAgent;
+ }
+ else if (typeof process !== 'undefined') {
+ localRunTimeEnv = 'node';
+ }
+ environment = new Environment(localRunTimeEnv, localUserAgent);
+ })();
+ return function () {
+ return environment;
+ };
+ }
+ SmartenvEnvironment.init = init;
+})(SmartenvEnvironment || (SmartenvEnvironment = {}));
+///
+var SmartenvObjectStorage;
+(function (SmartenvObjectStorage) {
+ function init() {
+ var obs = {};
+ var obsItems = {};
+ obs.addItem = function (objectArg, paramName) {
+ if (paramName === void 0) { paramName = "undefined"; }
+ if (paramName == "undefined") {
+ plugins.beautylog.error("paramName is undefined");
+ return;
+ }
+ obsItems[paramName] = objectArg;
+ };
+ obs.getItem = function (keyName) {
+ return obsItems[keyName];
+ };
+ obs.getComplete = function () {
+ return obsItems;
+ };
+ obs.addComplete = function (itemsArg) {
+ obsItems = plugins._.assign(obsItems, itemsArg);
+ return obsItems;
+ };
+ return obs;
+ }
+ SmartenvObjectStorage.init = init;
+})(SmartenvObjectStorage || (SmartenvObjectStorage = {}));
///
-///
-var beautylog = require("beautylog")("os");
+///
+///
+///
+var plugins = {
+ beautylog: require("beautylog")("os"),
+ _: require("lodash")
+};
var smartenv = {}; //create smartenv object
-smartenv.items = {}; // create the items object to store items to.
+smartenv.getEnv = SmartenvEnvironment.init();
+smartenv.obs = SmartenvObjectStorage.init();
/* ----------------------------------------- *
- * ----- Environment ----------------------- *
- * ----------------------------------------- */
-var environment;
-var setEnvironment = function () {
- var localRunTimeEnv = "undefined";
- var localUserAgent = "undefined";
- if (typeof window !== 'undefined') {
- localRunTimeEnv = 'browser';
- localUserAgent = navigator.userAgent;
- }
- else if (typeof process !== 'undefined') {
- localRunTimeEnv = 'node';
- }
- environment = new Environment(localRunTimeEnv, localUserAgent);
-};
-setEnvironment();
-smartenv.getEnv = function () {
- return environment;
-};
-/* ----------------------------------------- *
- * ----- Info vars ------------------------- *
+ * ----- print info ------------------------ *
* ----------------------------------------- */
smartenv.printEnv = function () {
- if (environment.isNode) {
+ if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
- beautylog.log("node version is " + environment.nodeVersion + " and smartenv version is " + smartenvVersion);
+ plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
}
else {
- beautylog.log("browser is " + environment.userAgent);
+ plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent);
}
- beautylog.log("the smartenv registration store currently holds the following properties:");
- console.log(Object.getOwnPropertyNames(smartenv.items).sort());
-};
-smartenv.register = function (objectArg, paramName) {
- if (paramName === void 0) { paramName = "undefined"; }
- if (paramName == "undefined") {
- beautylog.error("paramName is undefined");
- return;
- }
- smartenv.items[paramName] = objectArg;
-};
-smartenv.get = function (keyName) {
- return smartenv.items[keyName];
+ plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
+ console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
module.exports = smartenv;
diff --git a/package.json b/package.json
index c678dd2..871b1f5 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,8 @@
},
"homepage": "https://github.com/pushrocks/smartenv",
"dependencies": {
- "beautylog": "^1.0.4"
+ "beautylog": "^1.0.4",
+ "lodash": "^3.10.1"
},
"devDependencies": {
"gulp": "^3.9.0",
diff --git a/test.js b/test.js
index e1fb14d..0579eb9 100644
--- a/test.js
+++ b/test.js
@@ -4,11 +4,11 @@ var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module");
smartenv.printEnv();
beautylog.info("Now testing the smartenv module");
-smartenv.register({ key1: "Peter" }, "docit");
+smartenv.obs.addItem({ key1: "Peter" }, "docit");
smartenv.printEnv();
-beautylog.log(smartenv.get("docit").key1);
-beautylog.log(smartenv.get("docit").key1);
+beautylog.log(smartenv.obs.getItem("docit").key1);
+beautylog.log(smartenv.obs.getItem("docit").key1);
var key2 = "hello";
-smartenv.get("docit").key2 = key2;
-beautylog.log(smartenv.get("docit").key2);
+smartenv.obs.getItem("docit").key2 = key2;
+beautylog.log(smartenv.obs.getItem("docit").key2);
beautylog.success("Success!");
diff --git a/ts/classes.js.map b/ts/classes.js.map
deleted file mode 100644
index 681c131..0000000
--- a/ts/classes.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"classes.js","sourceRoot":"","sources":["classes.ts"],"names":["Environment","Environment.constructor"],"mappings":"AAAA,iCAAiC;AACjC;IAMIA,qBAAYA,aAAaA,EAACA,YAA0BA;QAA1BC,4BAA0BA,GAA1BA,0BAA0BA;QAChDA,IAAIA,CAACA,UAAUA,GAAGA,aAAaA,CAACA;QAChCA,IAAIA,CAACA,SAASA,GAAGA,YAAYA,CAACA;QAC9BA,EAAEA,CAAAA,CAACA,aAAaA,IAAIA,MAAMA,CAACA,CAAAA,CAACA;YACxBA,IAAIA,CAACA,SAASA,GAAGA,KAAKA,CAACA;YACvBA,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA;YACnBA,IAAIA,CAACA,WAAWA,GAAGA,OAAOA,CAACA,OAAOA,CAACA;QACvCA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,IAAIA,CAACA,SAASA,GAAGA,IAAIA,CAACA;YACtBA,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA;YACnBA,IAAIA,CAACA,WAAWA,GAAGA,WAAWA,CAACA;QACnCA,CAACA;IACLA,CAACA;;IACLD,kBAACA;AAADA,CAACA,AAnBD,IAmBC"}
\ No newline at end of file
diff --git a/ts/index.js b/ts/index.js
index 7c9ebb0..9a27f84 100644
--- a/ts/index.js
+++ b/ts/index.js
@@ -1,52 +1,27 @@
///
-///
-var beautylog = require("beautylog")("os");
+///
+///
+///
+var plugins = {
+ beautylog: require("beautylog")("os"),
+ _: require("lodash")
+};
var smartenv = {}; //create smartenv object
-smartenv.items = {}; // create the items object to store items to.
+smartenv.getEnv = SmartenvEnvironment.init();
+smartenv.obs = SmartenvObjectStorage.init();
/* ----------------------------------------- *
- * ----- Environment ----------------------- *
- * ----------------------------------------- */
-var environment;
-var setEnvironment = function () {
- var localRunTimeEnv = "undefined";
- var localUserAgent = "undefined";
- if (typeof window !== 'undefined') {
- localRunTimeEnv = 'browser';
- localUserAgent = navigator.userAgent;
- }
- else if (typeof process !== 'undefined') {
- localRunTimeEnv = 'node';
- }
- environment = new Environment(localRunTimeEnv, localUserAgent);
-};
-setEnvironment();
-smartenv.getEnv = function () {
- return environment;
-};
-/* ----------------------------------------- *
- * ----- Info vars ------------------------- *
+ * ----- print info ------------------------ *
* ----------------------------------------- */
smartenv.printEnv = function () {
- if (environment.isNode) {
+ if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
- beautylog.log("node version is " + environment.nodeVersion + " and smartenv version is " + smartenvVersion);
+ plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
}
else {
- beautylog.log("browser is " + environment.userAgent);
+ plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent);
}
- beautylog.log("the smartenv registration store currently holds the following properties:");
- console.log(Object.getOwnPropertyNames(smartenv.items).sort());
-};
-smartenv.register = function (objectArg, paramName) {
- if (paramName === void 0) { paramName = "undefined"; }
- if (paramName == "undefined") {
- beautylog.error("paramName is undefined");
- return;
- }
- smartenv.items[paramName] = objectArg;
-};
-smartenv.get = function (keyName) {
- return smartenv.items[keyName];
+ plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
+ console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
module.exports = smartenv;
//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/ts/index.js.map b/ts/index.js.map
index ffd1a10..2a1a480 100644
--- a/ts/index.js.map
+++ b/ts/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,mCAAmC;AACnC,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3C,IAAI,QAAQ,GAAO,EAAE,CAAC,CAAC,wBAAwB;AAC/C,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,6CAA6C;AAElE;;+CAE+C;AAC/C,IAAI,WAAuB,CAAC;AAC5B,IAAI,cAAc,GAAG;IACjB,IAAI,eAAe,GAAG,WAAW,CAAC;IAClC,IAAI,cAAc,GAAG,WAAW,CAAC;IACjC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;QAChC,eAAe,GAAG,SAAS,CAAC;QAC5B,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC;IACzC,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC;QACxC,eAAe,GAAG,MAAM,CAAC;IAC7B,CAAC;IACD,WAAW,GAAG,IAAI,WAAW,CAAC,eAAe,EAAC,cAAc,CAAC,CAAC;AAClE,CAAC,CAAC;AACF,cAAc,EAAE,CAAC;AAGjB,QAAQ,CAAC,MAAM,GAAG;IACd,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC,CAAC;AAEF;;+CAE+C;AAG/C,QAAQ,CAAC,QAAQ,GAAG;IAChB,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QACrB,IAAI,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC;QACxD,SAAS,CAAC,GAAG,CAAC,kBAAkB,GAAG,WAAW,CAAC,WAAW,GAAG,2BAA2B,GAAG,eAAe,CAAC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AAG5C;;+CAE+C;AAC/C,QAAQ,CAAC,QAAQ,GAAG;IAChB,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3B,IAAI,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC;QACxD,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,WAAW,GAAG,2BAA2B,GAAG,eAAe,CAAC,CAAC;IAC9H,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACnG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC7E,CAAC,CAAC;AAIF,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC"}
\ No newline at end of file
diff --git a/ts/index.ts b/ts/index.ts
index de9142c..330cc74 100644
--- a/ts/index.ts
+++ b/ts/index.ts
@@ -1,56 +1,31 @@
///
-///
-var beautylog = require("beautylog")("os");
+///
+///
+///
+var plugins = {
+ beautylog: require("beautylog")("os"),
+ _: require("lodash")
+}
var smartenv:any = {}; //create smartenv object
-smartenv.items = {}; // create the items object to store items to.
+
+smartenv.getEnv = SmartenvEnvironment.init();
+smartenv.obs = SmartenvObjectStorage.init();
+
/* ----------------------------------------- *
- * ----- Environment ----------------------- *
+ * ----- print info ------------------------ *
* ----------------------------------------- */
-var environment:Environment;
-var setEnvironment = function() {
- var localRunTimeEnv = "undefined";
- var localUserAgent = "undefined";
- if (typeof window !== 'undefined') {
- localRunTimeEnv = 'browser';
- localUserAgent = navigator.userAgent;
- } else if (typeof process !== 'undefined') {
- localRunTimeEnv = 'node';
- }
- environment = new Environment(localRunTimeEnv,localUserAgent);
-};
-setEnvironment();
-
-
-smartenv.getEnv = function() {
- return environment;
-};
-
-/* ----------------------------------------- *
- * ----- Info vars ------------------------- *
- * ----------------------------------------- */
-
-
smartenv.printEnv = function() {
- if (environment.isNode) {
+ if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
- beautylog.log("node version is " + environment.nodeVersion + " and smartenv version is " + smartenvVersion);
+ plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
} else {
- beautylog.log("browser is " + environment.userAgent)
+ plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent)
}
- beautylog.log("the smartenv registration store currently holds the following properties:");
- console.log(Object.getOwnPropertyNames(smartenv.items).sort());
+ plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
+ console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
-smartenv.register = function(objectArg,paramName = "undefined") {
- if (paramName == "undefined"){
- beautylog.error("paramName is undefined");
- return;
- }
- smartenv.items[paramName] = objectArg;
-};
-smartenv.get = function(keyName) {
- return smartenv.items[keyName];
-};
+
module.exports = smartenv;
diff --git a/ts/classes.js b/ts/smartenv.classes.js
similarity index 93%
rename from ts/classes.js
rename to ts/smartenv.classes.js
index 63ad52b..d15a945 100644
--- a/ts/classes.js
+++ b/ts/smartenv.classes.js
@@ -18,4 +18,4 @@ var Environment = (function () {
;
return Environment;
})();
-//# sourceMappingURL=classes.js.map
\ No newline at end of file
+//# sourceMappingURL=smartenv.classes.js.map
\ No newline at end of file
diff --git a/ts/smartenv.classes.js.map b/ts/smartenv.classes.js.map
new file mode 100644
index 0000000..7725a47
--- /dev/null
+++ b/ts/smartenv.classes.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"smartenv.classes.js","sourceRoot":"","sources":["smartenv.classes.ts"],"names":["Environment","Environment.constructor"],"mappings":"AAAA,iCAAiC;AACjC;IAMIA,qBAAYA,aAAaA,EAACA,YAA0BA;QAA1BC,4BAA0BA,GAA1BA,0BAA0BA;QAChDA,IAAIA,CAACA,UAAUA,GAAGA,aAAaA,CAACA;QAChCA,IAAIA,CAACA,SAASA,GAAGA,YAAYA,CAACA;QAC9BA,EAAEA,CAAAA,CAACA,aAAaA,IAAIA,MAAMA,CAACA,CAAAA,CAACA;YACxBA,IAAIA,CAACA,SAASA,GAAGA,KAAKA,CAACA;YACvBA,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA;YACnBA,IAAIA,CAACA,WAAWA,GAAGA,OAAOA,CAACA,OAAOA,CAACA;QACvCA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,IAAIA,CAACA,SAASA,GAAGA,IAAIA,CAACA;YACtBA,IAAIA,CAACA,MAAMA,GAAGA,IAAIA,CAACA;YACnBA,IAAIA,CAACA,WAAWA,GAAGA,WAAWA,CAACA;QACnCA,CAACA;IACLA,CAACA;;IACLD,kBAACA;AAADA,CAACA,AAnBD,IAmBC"}
\ No newline at end of file
diff --git a/ts/classes.ts b/ts/smartenv.classes.ts
similarity index 100%
rename from ts/classes.ts
rename to ts/smartenv.classes.ts
diff --git a/ts/smartenv.environment.js b/ts/smartenv.environment.js
new file mode 100644
index 0000000..73aa0ce
--- /dev/null
+++ b/ts/smartenv.environment.js
@@ -0,0 +1,27 @@
+///
+/**
+ * Deals with the environment the current JS script is running in.
+ */
+var SmartenvEnvironment;
+(function (SmartenvEnvironment) {
+ function init() {
+ var environment;
+ (function () {
+ var localRunTimeEnv = "undefined";
+ var localUserAgent = "undefined";
+ if (typeof window !== 'undefined') {
+ localRunTimeEnv = 'browser';
+ localUserAgent = navigator.userAgent;
+ }
+ else if (typeof process !== 'undefined') {
+ localRunTimeEnv = 'node';
+ }
+ environment = new Environment(localRunTimeEnv, localUserAgent);
+ })();
+ return function () {
+ return environment;
+ };
+ }
+ SmartenvEnvironment.init = init;
+})(SmartenvEnvironment || (SmartenvEnvironment = {}));
+//# sourceMappingURL=smartenv.environment.js.map
\ No newline at end of file
diff --git a/ts/smartenv.environment.js.map b/ts/smartenv.environment.js.map
new file mode 100644
index 0000000..02f4a7c
--- /dev/null
+++ b/ts/smartenv.environment.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"smartenv.environment.js","sourceRoot":"","sources":["smartenv.environment.ts"],"names":["SmartenvEnvironment","SmartenvEnvironment.init"],"mappings":"AAAA,iCAAiC;AACjC;;GAEG;AACH,IAAO,mBAAmB,CAoBzB;AApBD,WAAO,mBAAmB,EAAC,CAAC;IACxBA;QACIC,IAAIA,WAAuBA,CAACA;QAC5BA,CAACA;YACG,IAAI,eAAe,GAAG,WAAW,CAAC;YAClC,IAAI,cAAc,GAAG,WAAW,CAAC;YACjC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;gBAChC,eAAe,GAAG,SAAS,CAAC;gBAC5B,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC;YACzC,CAAC;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC;gBACxC,eAAe,GAAG,MAAM,CAAC;YAC7B,CAAC;YACD,WAAW,GAAG,IAAI,WAAW,CAAC,eAAe,EAAC,cAAc,CAAC,CAAC;QAClE,CAAC,CAACA,EAAEA,CAACA;QAGLA,MAAMA,CAACA;YACH,MAAM,CAAC,WAAW,CAAC;QACvB,CAAC,CAACA;IACNA,CAACA;IAlBeD,wBAAIA,OAkBnBA,CAAAA;AACLA,CAACA,EApBM,mBAAmB,KAAnB,mBAAmB,QAoBzB"}
\ No newline at end of file
diff --git a/ts/smartenv.environment.ts b/ts/smartenv.environment.ts
new file mode 100644
index 0000000..f27dbaf
--- /dev/null
+++ b/ts/smartenv.environment.ts
@@ -0,0 +1,25 @@
+///
+/**
+ * Deals with the environment the current JS script is running in.
+ */
+module SmartenvEnvironment {
+ export function init(){
+ var environment:Environment;
+ (function() {
+ var localRunTimeEnv = "undefined";
+ var localUserAgent = "undefined";
+ if (typeof window !== 'undefined') {
+ localRunTimeEnv = 'browser';
+ localUserAgent = navigator.userAgent;
+ } else if (typeof process !== 'undefined') {
+ localRunTimeEnv = 'node';
+ }
+ environment = new Environment(localRunTimeEnv,localUserAgent);
+ })();
+
+
+ return function() {
+ return environment;
+ };
+ }
+}
\ No newline at end of file
diff --git a/ts/smartenv.objectstorage.js b/ts/smartenv.objectstorage.js
new file mode 100644
index 0000000..2636a2d
--- /dev/null
+++ b/ts/smartenv.objectstorage.js
@@ -0,0 +1,29 @@
+///
+var SmartenvObjectStorage;
+(function (SmartenvObjectStorage) {
+ function init() {
+ var obs = {};
+ var obsItems = {};
+ obs.addItem = function (objectArg, paramName) {
+ if (paramName === void 0) { paramName = "undefined"; }
+ if (paramName == "undefined") {
+ plugins.beautylog.error("paramName is undefined");
+ return;
+ }
+ obsItems[paramName] = objectArg;
+ };
+ obs.getItem = function (keyName) {
+ return obsItems[keyName];
+ };
+ obs.getComplete = function () {
+ return obsItems;
+ };
+ obs.addComplete = function (itemsArg) {
+ obsItems = plugins._.assign(obsItems, itemsArg);
+ return obsItems;
+ };
+ return obs;
+ }
+ SmartenvObjectStorage.init = init;
+})(SmartenvObjectStorage || (SmartenvObjectStorage = {}));
+//# sourceMappingURL=smartenv.objectstorage.js.map
\ No newline at end of file
diff --git a/ts/smartenv.objectstorage.js.map b/ts/smartenv.objectstorage.js.map
new file mode 100644
index 0000000..8a22a5b
--- /dev/null
+++ b/ts/smartenv.objectstorage.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"smartenv.objectstorage.js","sourceRoot":"","sources":["smartenv.objectstorage.ts"],"names":["SmartenvObjectStorage","SmartenvObjectStorage.init"],"mappings":"AAAA,iCAAiC;AACjC,IAAO,qBAAqB,CAwB3B;AAxBD,WAAO,qBAAqB,EAAC,CAAC;IAC1BA;QACIC,IAAIA,GAAGA,GAAOA,EAAEA,CAACA;QACjBA,IAAIA,QAAQA,GAAOA,EAAEA,CAACA;QACtBA,GAAGA,CAACA,OAAOA,GAAGA,UAASA,SAASA,EAACA,SAAuBA;YAAvB,yBAAuB,GAAvB,uBAAuB;YACpD,EAAE,CAAC,CAAC,SAAS,IAAI,WAAW,CAAC,CAAA,CAAC;gBAC1B,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;gBAClD,MAAM,CAAC;YACX,CAAC;YACD,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;QACpC,CAAC,CAACA;QACFA,GAAGA,CAACA,OAAOA,GAAGA,UAASA,OAAOA;YAC1B,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC,CAACA;QACFA,GAAGA,CAACA,WAAWA,GAAGA;YACd,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC,CAAAA;QAEDA,GAAGA,CAACA,WAAWA,GAAGA,UAASA,QAAQA;YAC/B,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAC,QAAQ,CAAC,CAAC;YAC/C,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC,CAACA;QACFA,MAAMA,CAACA,GAAGA,CAACA;IACfA,CAACA;IAtBeD,0BAAIA,OAsBnBA,CAAAA;AACLA,CAACA,EAxBM,qBAAqB,KAArB,qBAAqB,QAwB3B"}
\ No newline at end of file
diff --git a/ts/smartenv.objectstorage.ts b/ts/smartenv.objectstorage.ts
new file mode 100644
index 0000000..56940cf
--- /dev/null
+++ b/ts/smartenv.objectstorage.ts
@@ -0,0 +1,26 @@
+///
+module SmartenvObjectStorage {
+ export function init() {
+ var obs:any = {};
+ var obsItems:any = {};
+ obs.addItem = function(objectArg,paramName = "undefined") {
+ if (paramName == "undefined"){
+ plugins.beautylog.error("paramName is undefined");
+ return;
+ }
+ obsItems[paramName] = objectArg;
+ };
+ obs.getItem = function(keyName) {
+ return obsItems[keyName];
+ };
+ obs.getComplete = function () {
+ return obsItems;
+ }
+
+ obs.addComplete = function(itemsArg) {
+ obsItems = plugins._.assign(obsItems,itemsArg);
+ return obsItems;
+ };
+ return obs;
+ }
+}
\ No newline at end of file
diff --git a/ts/test.js b/ts/test.js
index 8de8496..6c4a54c 100644
--- a/ts/test.js
+++ b/ts/test.js
@@ -4,12 +4,12 @@ var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module");
smartenv.printEnv();
beautylog.info("Now testing the smartenv module");
-smartenv.register({ key1: "Peter" }, "docit");
+smartenv.obs.addItem({ key1: "Peter" }, "docit");
smartenv.printEnv();
-beautylog.log(smartenv.get("docit").key1);
-beautylog.log(smartenv.get("docit").key1);
+beautylog.log(smartenv.obs.getItem("docit").key1);
+beautylog.log(smartenv.obs.getItem("docit").key1);
var key2 = "hello";
-smartenv.get("docit").key2 = key2;
-beautylog.log(smartenv.get("docit").key2);
+smartenv.obs.getItem("docit").key2 = key2;
+beautylog.log(smartenv.obs.getItem("docit").key2);
beautylog.success("Success!");
//# sourceMappingURL=test.js.map
\ No newline at end of file
diff --git a/ts/test.js.map b/ts/test.js.map
index 8de5334..1fe94ee 100644
--- a/ts/test.js.map
+++ b/ts/test.js.map
@@ -1 +1 @@
-{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,IAAI,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACrC,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;AAClD,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACpB,SAAS,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;AAClD,QAAQ,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,EAAC,OAAO,CAAC,CAAC;AAC1C,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACpB,SA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IAAI,CAAC;AAC1C,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAElD,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC"}
\ No newline at end of file
diff --git a/ts/test.ts b/ts/test.ts
index 5de1477..fa209bd 100644
--- a/ts/test.ts
+++ b/ts/test.ts
@@ -4,13 +4,13 @@ var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module");
smartenv.printEnv();
beautylog.info("Now testing the smartenv module");
-smartenv.register({key1:"Peter"},"docit");
+smartenv.obs.addItem({key1:"Peter"},"docit");
smartenv.printEnv();
-beautylog.log(smartenv.get("docit").key1);
-beautylog.log(smartenv.get("docit").key1);
+beautylog.log(smartenv.obs.getItem("docit").key1);
+beautylog.log(smartenv.obs.getItem("docit").key1);
var key2 = "hello";
-smartenv.get("docit").key2 = key2;
-beautylog.log(smartenv.get("docit").key2);
+smartenv.obs.getItem("docit").key2 = key2;
+beautylog.log(smartenv.obs.getItem("docit").key2);
beautylog.success("Success!");
\ No newline at end of file