Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function unParseField (f, k) {
// type can be an array or single thing.
var isPath = -1 !== [].concat(types[k]).indexOf(path)
if (isPath) {
if (typeof process.env.HOME !== 'undefined') {
if (process.env.HOME.substr(-1) === "/") {
process.env.HOME = process.env.HOME.slice(0, process.env.HOME.length-1)
}
if (f.indexOf(process.env.HOME) === 0) {
f = "~"+f.substr(process.env.HOME.length)
}
}
}
return (!f || typeof f !== "object") ? ini.safe(f) : f
return ini.safe(f)
}
function unParseField (f, k) {
// type can be an array or single thing.
var isPath = -1 !== [].concat(types[k]).indexOf(path)
if (isPath) {
if (typeof process.env.HOME !== 'undefined') {
if (process.env.HOME.substr(-1) === "/") {
process.env.HOME = process.env.HOME.slice(0, process.env.HOME.length-1)
}
if (f.indexOf(process.env.HOME) === 0) {
f = "~"+f.substr(process.env.HOME.length)
}
}
}
return (!f || typeof f !== "object") ? ini.safe(f) : f
return ini.safe(f)
}
function unParseField (f, k) {
// type can be an array or single thing.
var isPath = -1 !== [].concat(types[k]).indexOf(path)
if (isPath) {
if (typeof process.env.HOME !== 'undefined') {
if (process.env.HOME.substr(-1) === "/") {
process.env.HOME = process.env.HOME.slice(0, process.env.HOME.length-1)
}
if (f.indexOf(process.env.HOME) === 0) {
f = "~"+f.substr(process.env.HOME.length)
}
}
}
return (!f || typeof f !== "object") ? ini.safe(f) : f
return ini.safe(f)
}
function unParseField (f, k) {
// type can be an array or single thing.
var isPath = -1 !== [].concat(types[k]).indexOf(path)
if (isPath) {
if (typeof process.env.HOME !== 'undefined') {
if (process.env.HOME.substr(-1) === "/") {
process.env.HOME = process.env.HOME.slice(0, process.env.HOME.length-1)
}
if (f.indexOf(process.env.HOME) === 0) {
f = "~"+f.substr(process.env.HOME.length)
}
}
}
return (!f || typeof f !== "object") ? ini.safe(f) : f
return ini.safe(f)
}
Async.forEachOf(strings, (value, key, eachCallback) => {
let newValue;
if (_.isString(value)) {
newValue = this.getReplacement(value);
} else { newValue = value; }
if (!_.isBoolean(newValue) && !_.isNaN(_.toNumber(newValue))) {
newValue = _.toNumber(newValue);
}
_.set(data, key, Ini.safe(newValue));
eachCallback();
}, () => {
callback(null, data);
.then(contents => ini.safe(contents))
.then(props => coercer(props))