Comparing version 0.3.5 to 0.3.6
@@ -9,2 +9,3 @@ 'use strict' | ||
var j = require('path').join | ||
var realpath = require('fs-promise').realpath | ||
var resolvePath = require('path').resolve | ||
@@ -18,8 +19,12 @@ | ||
var realpathCache = {} | ||
function readFile (path) { | ||
return fs$readFile(path).then(function (buffer) { | ||
return { | ||
path: path, | ||
content: buffer | ||
} | ||
return realpath(path, realpathCache).then(function (path) { | ||
return fs$readFile(path).then(function (buffer) { | ||
return { | ||
path: path, | ||
content: buffer | ||
} | ||
}) | ||
}) | ||
@@ -26,0 +31,0 @@ } |
@@ -31,6 +31,7 @@ 'use strict' | ||
function fixPaths (value, base) { | ||
var RELATIVE_PATH_RE = /^\.{1,2}[/\\]/ | ||
function resolveRelativePaths (value, base) { | ||
var path | ||
if (isString(value)) { | ||
if (isString(value) && RELATIVE_PATH_RE.test(value)) { | ||
path = resolvePath(base, value) | ||
@@ -48,3 +49,3 @@ | ||
var promises = map(value, function (item, key) { | ||
return fixPaths(item, base).then(function (item) { | ||
return resolveRelativePaths(item, base).then(function (item) { | ||
value[key] = item | ||
@@ -81,3 +82,3 @@ }) | ||
return Bluebird.try(unserialize, [file]).then(function (value) { | ||
return fixPaths(value, dirname(file.path)) | ||
return resolveRelativePaths(value, dirname(file.path)) | ||
}).catch(UnknownFormatError, unknownFormatHandler) | ||
@@ -84,0 +85,0 @@ }).each(function (value) { |
{ | ||
"name": "app-conf", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "", | ||
@@ -8,3 +8,3 @@ "keywords": [], | ||
"lint": "standard", | ||
"test": "mocha --require must index.spec.js" | ||
"test": "npm run lint && mocha --require must index.spec.js" | ||
}, | ||
@@ -39,3 +39,2 @@ "repository": { | ||
"lodash.isstring": "^3", | ||
"lodash.keys": "^3", | ||
"lodash.map": "^3", | ||
@@ -42,0 +41,0 @@ "lodash.merge": "^3", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10002
12
257
0
3
- Removedlodash.keys@^3