Compare commits

..

8 Commits

Author SHA1 Message Date
28538001e9 0.0.10 2015-12-02 15:33:06 +01:00
9ec0b49716 refactored some functin names within obs module 2015-12-02 15:32:58 +01:00
cab52e1b02 0.0.9 2015-12-02 15:23:59 +01:00
d601a0eeb0 Merge branch 'master' of github.com:pushrocks/smartenv 2015-12-02 15:23:59 +01:00
491f22ffca clean up and fix some errors 2015-12-02 15:23:48 +01:00
1fec5323d9 closes #1 2015-12-01 08:29:58 +01:00
582afc0361 0.0.8 2015-11-30 20:01:08 +01:00
c054ecb0c7 cleaned up 2015-11-30 20:01:02 +01:00
19 changed files with 118 additions and 187 deletions

7
.gitignore vendored
View File

@ -1,3 +1,10 @@
node_modules/ node_modules/
.settings/ .settings/
.idea/ .idea/
#npm devug
npm-debug.log
ts/*.js
ts/*.js.map

View File

@ -24,25 +24,48 @@ var Environment = (function () {
*/ */
var SmartenvEnvironment; var SmartenvEnvironment;
(function (SmartenvEnvironment) { (function (SmartenvEnvironment) {
function init() { var environment;
var environment; var envDetermined = false;
(function () { /**
var localRunTimeEnv = "undefined"; * returns the environment
var localUserAgent = "undefined"; * @returns {Environment}
if (typeof window !== 'undefined') { */
localRunTimeEnv = 'browser'; var getEnv = function () {
localUserAgent = navigator.userAgent; if (!envDetermined) {
} (function () {
else if (typeof process !== 'undefined') { var localRunTimeEnv = "undefined";
localRunTimeEnv = 'node'; var localUserAgent = "undefined";
} if (typeof window !== 'undefined') {
environment = new Environment(localRunTimeEnv, localUserAgent); localRunTimeEnv = 'browser';
})(); localUserAgent = navigator.userAgent;
return function () { }
return environment; else if (typeof process !== 'undefined') {
}; localRunTimeEnv = 'node';
} }
SmartenvEnvironment.init = init; environment = new Environment(localRunTimeEnv, localUserAgent);
})();
}
;
return environment;
};
/**
* prints the environment to console
*/
var printEnv = function () {
if (this.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
plugins.beautylog.log("node version is " + this.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
}
else {
plugins.beautylog.log("browser is " + this.getEnv().userAgent);
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(smartenv.obs.getAll()));
};
SmartenvEnvironment.init = function (objectArg) {
objectArg.getEnv = getEnv;
objectArg.printEnv = printEnv;
};
})(SmartenvEnvironment || (SmartenvEnvironment = {})); })(SmartenvEnvironment || (SmartenvEnvironment = {}));
/// <reference path="index.ts" /> /// <reference path="index.ts" />
var SmartenvObjectStorage; var SmartenvObjectStorage;
@ -50,7 +73,7 @@ var SmartenvObjectStorage;
function init() { function init() {
var obs = {}; var obs = {};
var obsItems = {}; var obsItems = {};
obs.addItem = function (objectArg, paramName) { obs.add = function (objectArg, paramName) {
if (paramName === void 0) { paramName = "undefined"; } if (paramName === void 0) { paramName = "undefined"; }
if (paramName == "undefined") { if (paramName == "undefined") {
plugins.beautylog.error("paramName is undefined"); plugins.beautylog.error("paramName is undefined");
@ -58,10 +81,10 @@ var SmartenvObjectStorage;
} }
obsItems[paramName] = objectArg; obsItems[paramName] = objectArg;
}; };
obs.getItem = function (keyName) { obs.get = function (keyName) {
return obsItems[keyName]; return obsItems[keyName];
}; };
obs.getComplete = function () { obs.getAll = function () {
return obsItems; return obsItems;
}; };
obs.addComplete = function (itemsArg) { obs.addComplete = function (itemsArg) {
@ -81,20 +104,6 @@ var plugins = {
_: require("lodash") _: require("lodash")
}; };
var smartenv = {}; //create smartenv object var smartenv = {}; //create smartenv object
smartenv.getEnv = SmartenvEnvironment.init(); SmartenvEnvironment.init(smartenv);
smartenv.obs = SmartenvObjectStorage.init(); smartenv.obs = SmartenvObjectStorage.init();
/* ----------------------------------------- *
* ----- print info ------------------------ *
* ----------------------------------------- */
smartenv.printEnv = function () {
if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
}
else {
plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent);
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
module.exports = smartenv; module.exports = smartenv;

View File

@ -1,6 +1,6 @@
{ {
"name": "smartenv", "name": "smartenv",
"version": "0.0.7", "version": "0.0.10",
"description": "store things about your environment and let them travel across modules", "description": "store things about your environment and let them travel across modules",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

10
test.js
View File

@ -4,11 +4,11 @@ var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module"); beautylog.info("Now testing the smartenv module");
smartenv.printEnv(); smartenv.printEnv();
beautylog.info("Now testing the smartenv module"); beautylog.info("Now testing the smartenv module");
smartenv.obs.addItem({ key1: "Peter" }, "docit"); smartenv.obs.add({ key1: "Peter" }, "docit");
smartenv.printEnv(); smartenv.printEnv();
beautylog.log(smartenv.obs.getItem("docit").key1); beautylog.log(smartenv.obs.get("docit").key1);
beautylog.log(smartenv.obs.getItem("docit").key1); beautylog.log(smartenv.obs.get("docit").key1);
var key2 = "hello"; var key2 = "hello";
smartenv.obs.getItem("docit").key2 = key2; smartenv.obs.get("docit").key2 = key2;
beautylog.log(smartenv.obs.getItem("docit").key2); beautylog.log(smartenv.obs.get("docit").key2);
beautylog.success("Success!"); beautylog.success("Success!");

View File

@ -7,21 +7,7 @@ var plugins = {
_: require("lodash") _: require("lodash")
}; };
var smartenv = {}; //create smartenv object var smartenv = {}; //create smartenv object
smartenv.getEnv = SmartenvEnvironment.init(); SmartenvEnvironment.init(smartenv);
smartenv.obs = SmartenvObjectStorage.init(); smartenv.obs = SmartenvObjectStorage.init();
/* ----------------------------------------- *
* ----- print info ------------------------ *
* ----------------------------------------- */
smartenv.printEnv = function () {
if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
}
else {
plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent);
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
module.exports = smartenv; module.exports = smartenv;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,4CAA4C;AAC5C,gDAAgD;AAChD,kDAAkD;AAClD,IAAI,OAAO,GAAG;IACV,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;IACrC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC;CACvB,CAAA;AACD,IAAI,QAAQ,GAAO,EAAE,CAAC,CAAC,wBAAwB;AAE/C,QAAQ,CAAC,MAAM,GAAG,mBAAmB,CAAC,IAAI,EAAE,CAAC;AAC7C,QAAQ,CAAC,GAAG,GAAG,qBAAqB,CAAC,IAAI,EAAE,CAAC;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"} {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,4CAA4C;AAC5C,gDAAgD;AAChD,kDAAkD;AAClD,IAAI,OAAO,GAAG;IACV,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;IACrC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC;CACvB,CAAA;AACD,IAAI,QAAQ,GAAO,EAAE,CAAC,CAAC,wBAAwB;AAE/C,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACnC,QAAQ,CAAC,GAAG,GAAG,qBAAqB,CAAC,IAAI,EAAE,CAAC;AAI5C,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC"}

View File

@ -8,24 +8,9 @@ var plugins = {
} }
var smartenv:any = {}; //create smartenv object var smartenv:any = {}; //create smartenv object
smartenv.getEnv = SmartenvEnvironment.init(); SmartenvEnvironment.init(smartenv);
smartenv.obs = SmartenvObjectStorage.init(); smartenv.obs = SmartenvObjectStorage.init();
/* ----------------------------------------- *
* ----- print info ------------------------ *
* ----------------------------------------- */
smartenv.printEnv = function() {
if (smartenv.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
plugins.beautylog.log("node version is " + smartenv.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
} else {
plugins.beautylog.log("browser is " + smartenv.getEnv().userAgent)
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(smartenv.obs.getComplete).sort());
};
module.exports = smartenv; module.exports = smartenv;

View File

@ -1,21 +0,0 @@
/// <reference path="index.ts" />
var Environment = (function () {
function Environment(runtimeEnvArg, userAgentArg) {
if (userAgentArg === void 0) { 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";
}
}
;
return Environment;
})();
//# sourceMappingURL=smartenv.classes.js.map

View File

@ -1 +0,0 @@
{"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"}

View File

@ -2,7 +2,7 @@
class Environment { class Environment {
public runtimeEnv:string; public runtimeEnv:string;
public userAgent:string; public userAgent:string;
public nodeVersion; public nodeVersion:string;
public isBrowser:boolean; public isBrowser:boolean;
public isNode:boolean; public isNode:boolean;
constructor(runtimeEnvArg,userAgentArg = "undefined") { constructor(runtimeEnvArg,userAgentArg = "undefined") {

View File

@ -1,27 +0,0 @@
/// <reference path="index.ts" />
/**
* 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

View File

@ -1 +0,0 @@
{"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"}

View File

@ -3,23 +3,47 @@
* Deals with the environment the current JS script is running in. * Deals with the environment the current JS script is running in.
*/ */
module SmartenvEnvironment { 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);
})();
var environment:Environment;
var envDetermined:boolean = false;
return function() { /**
return environment; * returns the environment
* @returns {Environment}
*/
var getEnv = function(){
if (!envDetermined) {
(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 environment;
};
/**
* prints the environment to console
*/
var printEnv = function() {
if (this.getEnv().isNode) {
var smartenvVersion = require("./package.json").version;
plugins.beautylog.log("node version is " + this.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
} else {
plugins.beautylog.log("browser is " + this.getEnv().userAgent)
}
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
console.log(Object.getOwnPropertyNames(smartenv.obs.getAll()));
}
export var init = function(objectArg) {
objectArg.getEnv = getEnv;
objectArg.printEnv = printEnv;
} }
} }

View File

@ -1,29 +0,0 @@
/// <reference path="index.ts" />
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

View File

@ -1 +0,0 @@
{"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"}

View File

@ -3,17 +3,17 @@ module SmartenvObjectStorage {
export function init() { export function init() {
var obs:any = {}; var obs:any = {};
var obsItems:any = {}; var obsItems:any = {};
obs.addItem = function(objectArg,paramName = "undefined") { obs.add = function(objectArg,paramName = "undefined") {
if (paramName == "undefined"){ if (paramName == "undefined"){
plugins.beautylog.error("paramName is undefined"); plugins.beautylog.error("paramName is undefined");
return; return;
} }
obsItems[paramName] = objectArg; obsItems[paramName] = objectArg;
}; };
obs.getItem = function(keyName) { obs.get = function(keyName) {
return obsItems[keyName]; return obsItems[keyName];
}; };
obs.getComplete = function () { obs.getAll = function () {
return obsItems; return obsItems;
} }

View File

@ -4,12 +4,12 @@ var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module"); beautylog.info("Now testing the smartenv module");
smartenv.printEnv(); smartenv.printEnv();
beautylog.info("Now testing the smartenv module"); beautylog.info("Now testing the smartenv module");
smartenv.obs.addItem({ key1: "Peter" }, "docit"); smartenv.obs.add({ key1: "Peter" }, "docit");
smartenv.printEnv(); smartenv.printEnv();
beautylog.log(smartenv.obs.getItem("docit").key1); beautylog.log(smartenv.obs.get("docit").key1);
beautylog.log(smartenv.obs.getItem("docit").key1); beautylog.log(smartenv.obs.get("docit").key1);
var key2 = "hello"; var key2 = "hello";
smartenv.obs.getItem("docit").key2 = key2; smartenv.obs.get("docit").key2 = key2;
beautylog.log(smartenv.obs.getItem("docit").key2); beautylog.log(smartenv.obs.get("docit").key2);
beautylog.success("Success!"); beautylog.success("Success!");
//# sourceMappingURL=test.js.map //# sourceMappingURL=test.js.map

View File

@ -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,GAAG,CAAC,OAAO,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,EAAC,OAAO,CAAC,CAAC;AAC7C,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACpB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAClD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAElD,IAAI,IAAI,GAAG,OAAO,CAAC;AACnB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,GAAG,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"} {"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,GAAG,CAAC,GAAG,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,EAAC,OAAO,CAAC,CAAC;AACzC,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACpB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAC9C,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAE9C,IAAI,IAAI,GAAG,OAAO,CAAC;AACnB,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;AACtC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAE9C,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC"}

View File

@ -4,13 +4,13 @@ var beautylog = require("beautylog")("os");
beautylog.info("Now testing the smartenv module"); beautylog.info("Now testing the smartenv module");
smartenv.printEnv(); smartenv.printEnv();
beautylog.info("Now testing the smartenv module"); beautylog.info("Now testing the smartenv module");
smartenv.obs.addItem({key1:"Peter"},"docit"); smartenv.obs.add({key1:"Peter"},"docit");
smartenv.printEnv(); smartenv.printEnv();
beautylog.log(smartenv.obs.getItem("docit").key1); beautylog.log(smartenv.obs.get("docit").key1);
beautylog.log(smartenv.obs.getItem("docit").key1); beautylog.log(smartenv.obs.get("docit").key1);
var key2 = "hello"; var key2 = "hello";
smartenv.obs.getItem("docit").key2 = key2; smartenv.obs.get("docit").key2 = key2;
beautylog.log(smartenv.obs.getItem("docit").key2); beautylog.log(smartenv.obs.get("docit").key2);
beautylog.success("Success!"); beautylog.success("Success!");