resolve dependency loop
This commit is contained in:
parent
5636cf330e
commit
b1464d97bf
17
dist/smartenv.environment.js
vendored
17
dist/smartenv.environment.js
vendored
@ -1,8 +1,3 @@
|
|||||||
/// <reference path="typings/main.d.ts" />
|
|
||||||
/**
|
|
||||||
* Deals with the environment the current JS script is running in.
|
|
||||||
*/
|
|
||||||
var plugins = require("./smartenv.plugins");
|
|
||||||
var classes = require("./smartenv.classes");
|
var classes = require("./smartenv.classes");
|
||||||
var objectStorage = require("./smartenv.objectstorage");
|
var objectStorage = require("./smartenv.objectstorage");
|
||||||
var environment;
|
var environment;
|
||||||
@ -24,16 +19,16 @@ exports.getEnv = function () {
|
|||||||
*/
|
*/
|
||||||
exports.printEnv = function () {
|
exports.printEnv = function () {
|
||||||
if (this.getEnv().isNode) {
|
if (this.getEnv().isNode) {
|
||||||
plugins.beautylog.ok("running on NODE");
|
console.log("running on NODE");
|
||||||
var smartenvVersion = require("../package.json").version;
|
var smartenvVersion = require("../package.json").version;
|
||||||
plugins.beautylog.log("node version is " + this.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
|
console.log("node version is " + this.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plugins.beautylog.ok("running on BROWSER");
|
console.log("running on BROWSER");
|
||||||
plugins.beautylog.log("browser is " + this.getEnv().userAgent);
|
console.log("browser is " + this.getEnv().userAgent);
|
||||||
}
|
}
|
||||||
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
|
console.log("the smartenv registration store currently holds the following properties:");
|
||||||
console.log(Object.getOwnPropertyNames(objectStorage.obs.getAll()));
|
console.log(Object.getOwnPropertyNames(objectStorage.obs.getAll()));
|
||||||
};
|
};
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZW52LmVudmlyb25tZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU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LmxvZyhPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhvYmplY3RTdG9yYWdlLm9icy5nZXRBbGwoKSkpO1xufTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||||
|
11
dist/smartenv.objectstorage.js
vendored
11
dist/smartenv.objectstorage.js
vendored
@ -1,21 +1,22 @@
|
|||||||
/// <reference path="typings/main.d.ts" />
|
/// <reference path="typings/main.d.ts" />
|
||||||
var plugins = require("./smartenv.plugins");
|
var plugins = require("./smartenv.plugins");
|
||||||
|
var beautylog = require("beautylog");
|
||||||
exports.obs = {
|
exports.obs = {
|
||||||
add: function (paramNameArg, objectArg) {
|
add: function (paramNameArg, objectArg) {
|
||||||
if (paramNameArg === void 0) { paramNameArg = "undefined"; }
|
if (paramNameArg === void 0) { paramNameArg = "undefined"; }
|
||||||
if (objectArg === void 0) { objectArg = "undefined"; }
|
if (objectArg === void 0) { objectArg = "undefined"; }
|
||||||
if (paramNameArg == "undefined") {
|
if (paramNameArg == "undefined") {
|
||||||
plugins.beautylog.error("paramName is undefined");
|
beautylog.error("paramName is undefined");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (objectArg == "undefined") {
|
if (objectArg == "undefined") {
|
||||||
plugins.beautylog.error("objectArg is undefined");
|
beautylog.error("objectArg is undefined");
|
||||||
}
|
}
|
||||||
if (typeof exports.obsItems[paramNameArg] === "undefined") {
|
if (typeof exports.obsItems[paramNameArg] === "undefined") {
|
||||||
exports.obsItems[paramNameArg] = objectArg;
|
exports.obsItems[paramNameArg] = objectArg;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plugins.beautylog.error("object is already present, so add operation has failed.");
|
beautylog.error("object is already present, so add operation has failed.");
|
||||||
}
|
}
|
||||||
return exports.obsItems[paramNameArg];
|
return exports.obsItems[paramNameArg];
|
||||||
},
|
},
|
||||||
@ -27,7 +28,7 @@ exports.obs = {
|
|||||||
exports.obsItems[paramNameArg] = plugins._.assign(exports.obsItems[paramNameArg], objectArg);
|
exports.obsItems[paramNameArg] = plugins._.assign(exports.obsItems[paramNameArg], objectArg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plugins.beautylog.error("object is not present, so there is nothing to merge");
|
beautylog.error("object is not present, so there is nothing to merge");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
get: function (keyName) {
|
get: function (keyName) {
|
||||||
@ -43,4 +44,4 @@ exports.obs = {
|
|||||||
};
|
};
|
||||||
exports.obsItems = {};
|
exports.obsItems = {};
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZW52Lm9iamVjdHN0b3JhZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsMENBQTBDO0FBQzFDLElBQU8sT0FBTyxXQUFXLG9CQUFvQixDQUFDLENBQUM7QUFFcEMsV0FBRyxHQUFPO0lBQ2pCLEdBQUcsRUFBRSxVQUFTLFlBQTBCLEVBQUMsU0FBdUI7UUFBbEQsNEJBQTBCLEdBQTFCLDBCQUEwQjtRQUFDLHlCQUF1QixHQUF2Qix1QkFBdUI7UUFDNUQsRUFBRSxDQUFDLENBQUMsWUFBWSxJQUFJLFdBQVcsQ0FBQyxDQUFBLENBQUM7WUFDN0IsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsd0JBQXdCLENBQUMsQ0FBQztZQUNsRCxNQUFNLENBQUM7UUFDWCxDQUFDO1FBQ0QsRUFBRSxDQUFDLENBQUMsU0FBUyxJQUFJLFdBQVcsQ0FBQyxDQUFBLENBQUM7WUFDMUIsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsd0JBQXdCLENBQUMsQ0FBQztRQUN0RCxDQUFDO1FBQ0QsRUFBRSxDQUFDLENBQUMsT0FBTyxnQkFBUSxDQUFDLFlBQVksQ0FBQyxLQUFLLFdBQVcsQ0FBQyxDQUFBLENBQUM7W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FyZyl7XG4gICAgICAgIG9ic0l0ZW1zW3BhcmFtTmFtZUFyZ10gPSBvYmplY3RBcmc7XG4gICAgfSxcbiAgICBtZXJnZTogZnVuY3Rpb24ocGFyYW1OYW1lQXJnLG9iamVjdEFyZyl7XG4gICAgICAgIGlmKCEodHlwZW9mIG9ic0l0ZW1zW3BhcmFtTmFtZUFyZ10gPT09IFwidW5kZWZpbmVkXCIpKXtcbiAgICAgICAgICAgIG9ic0l0ZW1zW3BhcmFtTmFtZUFyZ10gPSBwbHVnaW5zLl8uYXNzaWduKG9ic0l0ZW1zW3BhcmFtTmFtZUFyZ10sb2JqZWN0QXJnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGJlYXV0eWxvZy5lcnJvcihcIm9iamVjdCBpcyBub3QgcHJlc2VudCwgc28gdGhlcmUgaXMgbm90aGluZyB0byBtZXJnZVwiKTtcbiAgICAgICAgfVxuICAgIH0sXG4gICAgZ2V0OiBmdW5jdGlvbihrZXlOYW1lKSB7XG4gICAgICAgIHJldHVybiBvYnNJdGVtc1trZXlOYW1lXTtcbiAgICB9LFxuICAgIGdldEFsbDogZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gb2JzSXRlbXM7XG4gICAgfSxcbiAgICBhZGRDb21wbGV0ZTogZnVuY3Rpb24oaXRlbXNBcmcpIHtcbiAgICAgICAgb2JzSXRlbXMgPSBwbHVnaW5zLl8uYXNzaWduKG9ic0l0ZW1zLGl0ZW1zQXJnKTtcbiAgICAgICAgcmV0dXJuIG9ic0l0ZW1zO1xuICAgIH1cbn07XG5leHBvcnQgdmFyIG9ic0l0ZW1zOmFueSA9IHt9OyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
||||||
|
3
dist/smartenv.plugins.js
vendored
3
dist/smartenv.plugins.js
vendored
@ -1,9 +1,8 @@
|
|||||||
/// <reference path="typings/main.d.ts" />
|
/// <reference path="typings/main.d.ts" />
|
||||||
var plugins = {
|
var plugins = {
|
||||||
beautylog: require("beautylog"),
|
|
||||||
Q: require("q"),
|
Q: require("q"),
|
||||||
_: require("lodash")
|
_: require("lodash")
|
||||||
};
|
};
|
||||||
module.exports = plugins;
|
module.exports = plugins;
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZW52LnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsMENBQTBDO0FBQzFDLElBQUksT0FBTyxHQUFHO0lBQ1YsU0FBUyxFQUFFLE9BQU8sQ0FBQyxXQUFXLENBQUM7SUFDL0IsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUM7SUFDZixDQUFDLEVBQUUsT0FBTyxDQUFDLFFBQVEsQ0FBQztDQUN2QixDQUFDO0FBRUYsaUJBQVMsT0FBTyxDQUFDIiwiZmlsZSI6InNtYXJ0ZW52LnBsdWdpbnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwidHlwaW5ncy9tYWluLmQudHNcIiAvPlxudmFyIHBsdWdpbnMgPSB7XG4gICAgYmVhdXR5bG9nOiByZXF1aXJlKFwiYmVhdXR5bG9nXCIpLFxuICAgIFE6IHJlcXVpcmUoXCJxXCIpLFxuICAgIF86IHJlcXVpcmUoXCJsb2Rhc2hcIilcbn07XG5cbmV4cG9ydCA9IHBsdWdpbnM7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZW52LnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsMENBQTBDO0FBQzFDLElBQUksT0FBTyxHQUFHO0lBQ1YsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUM7SUFDZixDQUFDLEVBQUUsT0FBTyxDQUFDLFFBQVEsQ0FBQztDQUN2QixDQUFDO0FBRUYsaUJBQVMsT0FBTyxDQUFDIiwiZmlsZSI6InNtYXJ0ZW52LnBsdWdpbnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwidHlwaW5ncy9tYWluLmQudHNcIiAvPlxudmFyIHBsdWdpbnMgPSB7XG4gICAgUTogcmVxdWlyZShcInFcIiksXG4gICAgXzogcmVxdWlyZShcImxvZGFzaFwiKVxufTtcblxuZXhwb3J0ID0gcGx1Z2luczsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||||
|
@ -27,13 +27,13 @@ export var getEnv = function(){
|
|||||||
*/
|
*/
|
||||||
export var printEnv = function() {
|
export var printEnv = function() {
|
||||||
if (this.getEnv().isNode) {
|
if (this.getEnv().isNode) {
|
||||||
plugins.beautylog.ok("running on NODE");
|
console.log("running on NODE");
|
||||||
var smartenvVersion = require("../package.json").version;
|
var smartenvVersion = require("../package.json").version;
|
||||||
plugins.beautylog.log("node version is " + this.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
|
console.log("node version is " + this.getEnv().nodeVersion + " and smartenv version is " + smartenvVersion);
|
||||||
} else {
|
} else {
|
||||||
plugins.beautylog.ok("running on BROWSER");
|
console.log("running on BROWSER");
|
||||||
plugins.beautylog.log("browser is " + this.getEnv().userAgent);
|
console.log("browser is " + this.getEnv().userAgent);
|
||||||
}
|
}
|
||||||
plugins.beautylog.log("the smartenv registration store currently holds the following properties:");
|
console.log("the smartenv registration store currently holds the following properties:");
|
||||||
console.log(Object.getOwnPropertyNames(objectStorage.obs.getAll()));
|
console.log(Object.getOwnPropertyNames(objectStorage.obs.getAll()));
|
||||||
};
|
};
|
@ -1,19 +1,19 @@
|
|||||||
/// <reference path="typings/main.d.ts" />
|
/// <reference path="typings/main.d.ts" />
|
||||||
import plugins = require("./smartenv.plugins");
|
import plugins = require("./smartenv.plugins");
|
||||||
|
var beautylog = require("beautylog");
|
||||||
export var obs:any = {
|
export var obs:any = {
|
||||||
add: function(paramNameArg = "undefined",objectArg = "undefined") {
|
add: function(paramNameArg = "undefined",objectArg = "undefined") {
|
||||||
if (paramNameArg == "undefined"){
|
if (paramNameArg == "undefined"){
|
||||||
plugins.beautylog.error("paramName is undefined");
|
beautylog.error("paramName is undefined");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (objectArg == "undefined"){
|
if (objectArg == "undefined"){
|
||||||
plugins.beautylog.error("objectArg is undefined");
|
beautylog.error("objectArg is undefined");
|
||||||
}
|
}
|
||||||
if (typeof obsItems[paramNameArg] === "undefined"){
|
if (typeof obsItems[paramNameArg] === "undefined"){
|
||||||
obsItems[paramNameArg] = objectArg;
|
obsItems[paramNameArg] = objectArg;
|
||||||
} else {
|
} else {
|
||||||
plugins.beautylog.error("object is already present, so add operation has failed.");
|
beautylog.error("object is already present, so add operation has failed.");
|
||||||
}
|
}
|
||||||
return obsItems[paramNameArg];
|
return obsItems[paramNameArg];
|
||||||
},
|
},
|
||||||
@ -24,7 +24,7 @@ export var obs:any = {
|
|||||||
if(!(typeof obsItems[paramNameArg] === "undefined")){
|
if(!(typeof obsItems[paramNameArg] === "undefined")){
|
||||||
obsItems[paramNameArg] = plugins._.assign(obsItems[paramNameArg],objectArg);
|
obsItems[paramNameArg] = plugins._.assign(obsItems[paramNameArg],objectArg);
|
||||||
} else {
|
} else {
|
||||||
plugins.beautylog.error("object is not present, so there is nothing to merge");
|
beautylog.error("object is not present, so there is nothing to merge");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
get: function(keyName) {
|
get: function(keyName) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/// <reference path="typings/main.d.ts" />
|
/// <reference path="typings/main.d.ts" />
|
||||||
var plugins = {
|
var plugins = {
|
||||||
beautylog: require("beautylog"),
|
|
||||||
Q: require("q"),
|
Q: require("q"),
|
||||||
_: require("lodash")
|
_: require("lodash")
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user