How to use the ini.safe function in ini

To help you get started, we’ve selected a few ini examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graalvm / graaljs / deps / npm / lib / utils / ini.js View on Github external
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)
}
github graalvm / graaljs / deps / npm / lib / utils / ini.js View on Github external
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)
}
github nullivex / nodist / bin / node_modules / npm / lib / utils / ini.js View on Github external
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)
}
github nullivex / nodist / bin / node_modules / npm / lib / utils / ini.js View on Github external
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)
}
github pterodactyl / daemon / src / helpers / fileparser.js View on Github external
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);
github tableflip / guvnor / lib / operations / common / lib / load-options.js View on Github external
  .then(contents => ini.safe(contents))
  .then(props => coercer(props))

ini

An ini encoder/decoder for node

ISC
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis