Comparing version 0.2.4 to 0.2.5
@@ -5,2 +5,3 @@ var _ = require("underscore"); | ||
var os = require("os"); | ||
var min = require("jsonminify"); | ||
@@ -15,5 +16,6 @@ var env = process.env; | ||
var values = replaceAll(config[mode] || config["development"], env); | ||
var globalValues = replaceAll(config, env); | ||
var modeValues = replaceAll(config[mode] || config["development"], env); | ||
function get(key, envKey, vars) { | ||
function get(values, key, envKey, vars) { | ||
var value = env[envKey] || values[key] || defaults[key]; | ||
@@ -26,24 +28,26 @@ if (vars && _.isString(value)) value = replaceStr(value, vars); | ||
// @todo add globalValues accessors | ||
port: function () { | ||
return get("port", "PORT"); | ||
return get(modeValues, "port", "PORT"); | ||
}, | ||
localBaseUrl: function () { | ||
return get("localBaseUrl", "AP3_LOCAL_BASE_URL", {port: this.port()}); | ||
return get(modeValues, "localBaseUrl", "AP3_LOCAL_BASE_URL", {port: this.port()}); | ||
}, | ||
store: function () { | ||
return values["store"] || defaults["store"]; | ||
return modeValues["store"] || defaults["store"]; | ||
}, | ||
hosts: function () { | ||
return get("hosts"); | ||
return get(modeValues, "hosts"); | ||
}, | ||
publicKey: function () { | ||
return get(null, "AP3_PUBLIC_KEY") || publicKey; | ||
return get(modeValues, null, "AP3_PUBLIC_KEY") || publicKey; | ||
}, | ||
privateKey: function () { | ||
return get(null, "AP3_PRIVATE_KEY") || privateKey; | ||
return get(modeValues, null, "AP3_PRIVATE_KEY") || privateKey; | ||
}, | ||
@@ -60,2 +64,3 @@ | ||
var defaults = { | ||
// @todo add globalValues defaults | ||
port: 3000, | ||
@@ -104,3 +109,3 @@ localBaseUrl: "http://" + os.hostname() + ":$port", | ||
var data = loadFile(path); | ||
return data ? JSON.parse(data) : {}; | ||
return data ? JSON.parse(min(data)) : {}; | ||
} |
{ | ||
"name": "ap3", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Helper package for Atlassian Plugins 3 add-ons running on Express", | ||
@@ -16,3 +16,4 @@ "dependencies": { | ||
"optimist": "~0.4.0", | ||
"colors": "~0.6.0" | ||
"colors": "~0.6.0", | ||
"jsonminify": "~0.1.0" | ||
}, | ||
@@ -19,0 +20,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
29793
890
0
12
+ Addedjsonminify@~0.1.0
+ Addedjsonminify@0.1.2(transitive)